- Open on Drupal.org βCore: 9.5.x + Environment: PHP 8.0 & MySQL 5.7last update
over 1 year ago Not currently mergeable. - @benjifisher opened merge request.
- πΊπΈUnited States benjifisher Boston area
I am updating the version to 6.0.x. I also created a new MR based on that branch and the patch in #40.
- πΊπΈUnited States pixlkat
I installed the MR version of migrate_plus using the instructions above on a vanilla D10 site with the minimal profile and created a test content type to use as the destination for the test migration.
I created module with a simple migration using a sample JSON file source (attached) and was successful in using a selector to limit the items which were migrated. The JSON contains an attribute named "favoriteFruit"; the item_selector in the migration selects those with favoriteFruit=strawberry. My migration only imported the items with the matching selector with no errors.
My simple migration:
id: test_data label: Migrate Test Data source: plugin: url data_fetcher_plugin: file data_parser_plugin: jsonpath urls: - modules/custom/migration_test/data/people.json item_selector: '$.people[?(@.favoriteFruit=strawberry)]' fields: - name: guid label: 'GUID' selector: guid - name: name label: 'Person name' selector: name - name: age label: 'Age' selector: age - name: gender label: 'Gender' selector: gender - name: company label: 'Company' selector: company - name: about label: 'About' selector: about - name: favorite_fruit label: 'Favorite Fruit' selector: favoriteFruit ids: guid: type: string process: type: plugin: default_value default_value: people title: name field_age: age field_gender: gender field_company: company body/value: about body/format: plugin: default_value default_value: plain_text field_favorite_fruit: favorite_fruit destination: plugin: 'entity:node' migration_dependencies: { } dependencies: enforced: module: - migration_test
- last update
over 1 year ago 192 pass - Status changed to Needs work
over 1 year ago 1:59am 24 June 2023 - πΊπΈUnited States benjifisher Boston area
@pixlcat:
Thanks for testing this, and for adding JSONPath links to the issue summary.
Since we looked at this issue at DrupalCon earlier this month, I am adding the tag for that.
I reviewed the changes. It mostly looks good, but I would like a little code cleanup. I am setting the status to NW, and I will re-review promptly. Let's try to get this issue done!
One of my review comments will require a bit of research and/or experimentation.
- last update
over 1 year ago 192 pass - Status changed to Needs review
about 1 year ago 9:53pm 14 September 2023 - πΊπΈUnited States pixlkat
@benjifisher I guess I didn't set this back to needs review. Doing that here.