test for struct bureaucracy multi field bug #396
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, it is not possible to use struct multi fields with bureaucracy forms.
There seem to be two issues that are related to this:
The problem is that for a multi-field the
$valueis not a string, but an array and in line 475 in the buraucracy plugin we try to replace a string-pattern with an array of values. That fails andpreg_replacereturns something falsy:https://github.com/splitbrain/dokuwiki-plugin-bureaucracy/blob/7357d7100908ee44b2bc672128301825c9dcb8f4/syntax.php#L466-L478
I'm not yet sure where/how to fix that. Based on the issues above, reverting to an earlier version of bureaucracy works, so a fix should be consistent with whatever that earlier version of bureaucracy does.
The place above would be an obvious possible place to join the array elements, alternatively this could also be done in the respective field helper in the struct plugin before the value is set:
dokuwiki-plugin-struct/helper/field.php
Line 64 in a8bbb00
This needs a bit more research.