- Issue created by @arwillame
- Merge request !80keep array in rest query if it contains more that 1 value → (Merged) created by arwillame
- First commit to issue fork.
- 🇫🇷France guignonv Montpellier
Looks good. Just to make sure I understand everything, it means you would get a single entity with no text keys and you will have to map numeric "keys" to fields then, right?
- 🇧🇪Belgium arwillame Belgium 🇧🇪
Correct, i create a custom_field "Expertise Item field" that have a "firstname" and "lastname" field.
Then i can map then like : firstname => $.*.firstName
This will populate the "Expertise Item field" with multiple items with each have "firstname" and "lastname" filled in. - 🇫🇷France guignonv Montpellier
@arwillame, could you add a test in RestClientFunctionalTest.php to test your use case and ensure the fix remains stable in the future?
Your use case could be documented in the test to avoid regressions. - 🇧🇪Belgium arwillame Belgium 🇧🇪
I found an issue with this logic.
I have cases where the result is indeed an array because multiple value are possible, but if there is only one result anyway, i want to keep the same logic as it was multiple.
I think the best would be to just remove the code that makes the "reset($array)" to avoid this issue.
The handling of an array of a single value should not be handled in code but in the field mapping.
I created a new MR for this proposal.