Commit 594d262e authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Cédric Le Ninivin

erp5_core: Ignore non-existent transitions in Module_listWorkflowTransitionItemList

instead of crashing.

This can happen in workflow if we have:
- transition_x is declared as possible in state_x
- then transition_x gets deleted
In this case in state_x in manage_properties nothing is visible,
which creates an inconsistent in its data, yet functional generally workflow

Since it is easy to create such cases, just ignore them in Module_listWorkflowTransitionItemList
so that mass change state can work
parent 0f34a59b
......@@ -35,9 +35,10 @@ for document_portal_type_id in module_portal_type.getTypeAllowedContentTypeList(
allowed_state_dict[possible_transition_id].append(state_id)
else:
allowed_state_dict[possible_transition_id] = [state_id]
for transition_id in allowed_state_dict:
transition = workflow.transitions[transition_id]
transition = workflow.transitions.get(transition_id, None)
if transition is None:
continue
# Only display user action transition with a dialog to show to user
if (transition.trigger_type == TRIGGER_USER_ACTION) and (transition.actbox_url) and (transition.actbox_name):
action_form_id = transition.actbox_url.rsplit('/', 1)[1].split('?')[0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment