Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
bd4b8d10
Commit
bd4b8d10
authored
Feb 21, 2024
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: Don't crash jump if there's no portal_type defined and no related document
parent
b26506a6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
...teItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
+7
-2
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
View file @
bd4b8d10
...
...
@@ -49,10 +49,15 @@ related_list = search_method(portal_type = portal_type)
relation_found
=
0
if
len
(
related_list
)
==
0
:
if
portal_type
:
# Use the first one for the message
document_caption
=
portal_type
[
0
]
else
:
document_caption
=
'Document'
message
=
Base_translateString
(
'No %s Related'
%
portal_type
[
0
]
,
'No %s Related'
%
document_caption
,
default
=
Base_translateString
(
'No ${portal_type} related.'
,
mapping
=
{
'portal_type'
:
Base_translateString
(
portal_type
[
0
]
)}))
mapping
=
{
'portal_type'
:
Base_translateString
(
document_caption
)}))
elif
len
(
related_list
)
==
1
:
relation_found
=
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment