dokuwiki-plugin-bureaucracy
dokuwiki-plugin-bureaucracy copied to clipboard
Changed prepareFieldReplacement function
I found that if using conditional selectboxes having all the same label, replacement goes wrong. E.G.: i have this form:
In the tpl_mailform i use placeholders like "@@Object@@" and "@@Issue@@".
As you can see, only one of the select-boxes named "Issue" can be selected in the form and will contain a valid value, later on. If i select the first object "O1" and give it a value and process the form, the function "prepareFieldReplacement()" is called with the first label/value but also the second and third, where there is no value. So they will overwrite each other and the last one wins! You can check this by selecting "O3" and an "Issue" and will get a correct result. All other object selections leads to a non-replaced placeholder.
My PR fix this by not only checking for a not-null $label, but also for a not-null $value.