ERP5Type.mixin.component: Do not fail when workflow_history is not present.
workflow_history attribute may not exist on bootstrapping (constructInstance), which leads AttributeError exception, which could have further side-effects as this is called during dynamic class initialisation. Also, original code from CMFCore.WorkflowTool, from which this code is derived for bootstrap reasons, catches KeyError (when history exists, just not for considered workflow), so follow the same pattern. Laslty, also catch IndexError in case the workflow history entry would exist empty - which would be the sign of a broken workflow history.
Showing
Please register or sign in to comment