Don't assume machine names are unique without enforcing it
It's currently possible to have the same machine name for two actions. When this happens, Form Processor doesn't allow you to select the full range of output actions.
Steps to replicate
Set up a form processor.
- Create an action "Action 1" that has an output you can use in future actions (e.g. "Create or update individual").
- Create an action "Action 2", with a machine name of
action_2
. - Create an action "Action 3" that has an output.
- Create an action "Action 4" with a machine name of
action_2
. - Edit Action 4 and attempt to select the output of Action 3.
Expected Result
Action 4 can use outputs of any prior action.
Actual Result
Action 4 can only use outputs defined prior to Action 2, which shares its machine name.
Now the ideal scenario would be to enforce unique machine names, but I don't think my JS skills are that good. However, when determining which actions should be available, the code says, "Don't load outputs for any action that comes after the action with the same machine name as the current action."
I've changed that to "Don't load outputs for any action that comes after the action with the same ID as the current action." This is guaranteed to be unique.