- Issue created by @huzooka
- Merge request !102Issue #3465782: Using "/" item_selector in Json parser plugin config does not work as expected anymore β (Open) created by huzooka
- Merge request !103Resolve #3465782 Full backward compatibility for JSON parser plugin's item_selector β (Open) created by huzooka
- Issue was unassigned.
- Status changed to Needs review
4 months ago 6:36am 5 August 2024 - ππΊHungary huzooka Hungary ππΊπͺπΊ
Created two MRs:
* 3465782-using-slash-json-parser (MR 102) restores support for "/" item selector.
* 3465782-full-bc-json-parser (MR 103) fully restores the previous behavior with (faulty) item selectors. (Look at the new test in JsonTest).I don't think I can do anything for the "max PHP version" tests - seems that the phpunit.xml is build for a Drupal version which still had "HtmlOutputPrinter", but the actual artifact contains Drupal 11, which does not have the class anymore.
Asking for review (and further ideas).
- π¨πSwitzerland steva1982
Hi,
I have the same problem because my migration YML file haditem_selector: /
.
Looking for other issues, I found only this morning this trick π Add note about item_selector: 0 in Migrate JSON Example module RTBC and it works for me.
Probably is not the best solution, but for the moment it allows me to import. - π¦πΊAustralia sonnykt Melbourne, Australia
Confirm the issue when using the JSON data_parser with
item_selector: /
.getResponseContent()
returns the correct data butgetSourceData()
always returns an empty array.My debugging also leads to the same line which was changed in this MR https://git.drupalcode.org/project/migrate_plus/-/merge_requests/81/diff....
As a workaround, I have to use
item_selector: ''
to make migrations work again. - πΊπΈUnited States dasginganinja Bethlehem, PA
We just realized today that this stopped our migrations from running.
We had the following value:item_selector: /events/event
After updating this to `events` this started working in 6.0.4.
Our item selectors were all using the format of `event/field_name` already. I'm surprised this was working in the first place. π
- πΊπΈUnited States alison
Our JSON source migrations are also still broken, on 6.0.4, and fixed/fine when we revert to 6.0.2.
I wasn't able to apply MR 102 or 103 to 6.0.4, I haven't tried with 6.0.x yet, I was pausing first, because GitLab says the pipelines failed with those anyway (but I might still try).
(I'm afraid I don't have other ideas to contribute!)
- π©πͺGermany szeidler Berlin
For some of our migrations it also has been a breaking change.
item_selector: '/'
we have been able to change toitem_selector: 0
, which kept the desired elements selected (in our case a JSON that directly starts with an array of objects).