- Issue created by @majorrobot
- 🇺🇸United States majorrobot
I've pushed up a branch with some work into using
\Drupal::service('entity_field.manager')->getFieldDefinitions('node', ‘[bundle]')
. I don't necessarily think it's going to work out, but I wanted to push it up for reference.https://git.drupalcode.org/issue/ai_migration-3538092/-/tree/3538092-spi...
- 🇺🇸United States majorrobot
majorrobot → changed the visibility of the branch 3538092-spike-investigate-schema to hidden.
- 🇺🇸United States majorrobot
I've played with the Schemata module, and can get a bundle schema created using that and jsonapi.
I think we need to merge in https://www.drupal.org/project/ai_migration/issues/3539641 📌 Support images in AiMigrator Active first, as there are a lot of changes in there that this issue could use.
- @majorrobot opened merge request.
- 🇺🇸United States majorrobot
New MR for review: https://git.drupalcode.org/project/ai_migration/-/merge_requests/16
This one switches out the hard-coded bundle schemas with a dynamic method that uses the Schemata module and core serialization. The result may be a bit overkill, but is progress — and if nothing else — proof of concept.
To test:
1. ddev poser
2. Follow CONTRIBUTIONS.md for the modules to enable. In most cases, you will need to:
3. ddev drush en schemata,schemata_json_schema,jsonapi
4. ddev drush cr
5. Run ddev drush ev "\Drupal::service('ai_migration.ai_migrator')->convert('https://lincs.ed.gov/professional-development/resource-collections/profi...', '', 'node', 'easy_migration_example');"
6. Log in as an admin.
7. Go to /admin/reports/dblog
8. Locate a record that begins with “AI migration schema for url…”
9. Click on the record.
10. Verify that it there is a json schema in the message. (Apologies -- you may want to copy the json out of the message and paste into a tool that will prettify it.) - 🇺🇸United States dmundra Eugene, OR
Thank you @majorrobot, tested following your steps and I did get a JSON schema in the log. Did notice a failing test in the MR.
- 🇺🇸United States dmundra Eugene, OR
Test needs work so switching status to that after leaving comments.
-
majorrobot →
committed de1b45d3 on 1.0.x
Issue #3538092: Add schema creation
-
majorrobot →
committed de1b45d3 on 1.0.x