Problem/Motivation

Spinoff #3516531: Add body field picker w default to wizard & processing. since the Drupal CMS wants an entity reference field as a default field choice we should really line that up. aka the wordpress "post thumbnail"

Proposed resolution

Per #3516531: Add body field picker w default to wizard & processing we are looking at a regular image field so far. per #3173916: Import as media we are looking at importing image and other attachment types as Drupal "media". this may need to be a little different, to cover the entity reference instead (if it has different settings than Drupal 'media' fields). check the code around here for more: https://git.drupalcode.org/project/wordpress_migrate/-/merge_requests/39...

inside class ImageSelectForm extends FormBase would be these settings changed or UI updated.

Remaining tasks

  • modify import form to show entity reference fields that exist and can have the image loaded (this could be a separate dropdown from media fields and image fields i think?)
  • write the import migration as needed to the other field (may need to change yml files)
  • change $migration = $this->createEntityFromPlugin('wordpress_attachments', $this->attachmentID); probably.
  • save the record and try to have a migration when save fails
  • try to factor in if the remote host is down and halt if so, but keep going if a single image is 404. #3518677: attachments / featured images not fault tolerant if missing

User interface changes

modify import form to show entity reference fields that exist and can have the image loaded.

API changes

the form result array state would change somehow. such as a key like 'import_featured_image_to_entity_reference_field' and the value is the fieldname.

Data model changes

similar issue to form result array and also configuration entities would need to have a similar record.

Comments

hongpong created an issue. See original summary.

hongpong’s picture

hongpong’s picture

Issue summary: View changes
hongpong’s picture

Issue summary: View changes
hongpong’s picture

Issue summary: View changes
hongpong’s picture

Issue summary: View changes
hongpong’s picture

Issue summary: View changes
hongpong’s picture

Issue summary: View changes