-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Channel: mapped numeric IDs get lost when using fieldsets #495
Comments
@simon-matt-oetztal: Hey Simon, thanks for the investigation. I'm not quite sure if this is the right way to do this. But I'm also not sure if I'm getting your issue in the first place! :) I think there might be an issue regarding fieldsets with mapped/unmapped subfields, but I have to check it first. There is this notification at the bottom of the API mapping window:
I've added it after the container field mapping feature came out, but I think there's something odd with it. I was not able to see subfields as an array branch, when I also set the mapping to the fieldset itself (so the statement is therefore not true). Could you please provide me a screenshot of the API mapping window? |
Hi @solverat, The main issue is, that our field keys of the API are integers. So it's crucial to keep the correct integer as key in the array to be able to assign the values to the correct fields of the API. Using I was not aware of the notification mentioned. But as you said the fields are returned flat. thx for your support! |
@simon-matt-oetztal Thanks for the feedback. I'm able to reproduce it now.
Thank you! |
When the API Channel is using numeric IDs for the mapped fields, the IDs get lost when fieldsets are used.
In our case the mapped nodes array should look like this:
[ 46 => "1", 1 => "Simon", 2 => "Matt", 3 => "[email protected]", 14 => 10, 4548 => "2" ]
but looks like:
[ 0 => "1", 1 => "Simon", 2 => "Matt", 3 => "[email protected]", 4 => 10, 5 => "2" ]
This is caused by "array_merge":
https://github.com/dachcom-digital/pimcore-formbuilder/blob/master/src/OutputWorkflow/Channel/Api/ApiOutputChannelWorker.php#L131
solution: using "array_replace"
The text was updated successfully, but these errors were encountered: