symbiote / silverstripe-advancedworkflow

A highly configurable step-based workflow module.
BSD 3-Clause "New" or "Revised" License
47 stars 71 forks source link

advancedworkflow.js breaks if Workflow actions are not on page in CMS #416

Open wakes opened 4 years ago

wakes commented 4 years ago

Hi. If the workflow actions are not rendered into the CMS (e.g. WorkflowApplicable extension fails permission check line ~186) then the advancedworkflow.js script fails trying to process a click event because fields it is trying to do a replace on non-existant attribute 'name' value , see advanced-workflow-cms.js:~12. Should be some defensive coding in there to check that the field/attribute exists.

This is an issue in CWP as we can't seem to disable the AdvancedWorkflows module as part of the recipe.

Cheers, Steve

emteknetnz commented 4 years ago

Hi Steve, thanks for reporting

Would you be keen to submit a PR to fix this issue, or at least some code that you think would fix this issue?