Skip to content

Conversation

@micgro42
Copy link
Contributor

@micgro42 micgro42 commented May 1, 2018

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 $value is 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 and preg_replace returns 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:

$this->opt['value'] = $value;

This needs a bit more research.

@micgro42 micgro42 force-pushed the bureaucracyMultiBug branch from 165558f to ee13f2f Compare August 6, 2018 07:37
@micgro42 micgro42 force-pushed the bureaucracyMultiBug branch from ee13f2f to 4a42f07 Compare August 6, 2018 07:51
@micgro42 micgro42 merged commit 0507564 into master Aug 6, 2018
@micgro42 micgro42 deleted the bureaucracyMultiBug branch August 6, 2018 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants