Non-abstract plugins created using the default "add" action are created as many times as the form is rebuilt. The consequence is that plugins with parameters not restricted to an input mode are recreated every time the input mode is switched. So, if the "add" form starts out with a parameter in input mode, the user switches to selector, picks a variables, and then saves, two of the elements have been created, with the first potentially failing integrity tests (since no settings have been provided).
To demonstrate this problem, create a "switch" (Conditional Rules) and go to the form for adding a case. Switch the input mode back and forth several times before picking a value and saving. There will now be as many new cases as number of times switched. Every case except the last has an integrity error.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1676998-01-add-element-create-once.patch | 569 bytes | zhangtaihao |
Comments
Comment #1
zhangtaihao commentedThe fix is actually insanely simple. It was just never really a situation to contend with because abstract plugins (i.e. conditions, actions) already have the check.
Comment #2
zhangtaihao commentedComment #3
zhangtaihao commentedCross-reference:
#1666890: Switching input mode causes multiple cases to be added
Comment #4
mitchell commentedThis works for me. Thanks, zhangaithao.
Comment #5
zhangtaihao commentedCross-referencing post:
#1681510: Add plugin factory to UI
Comment #6
zhangtaihao commentedNote this issue is made obsolete by #1681510: Add plugin factory to UI.