Any way to use on existing fields?

Created on 14 September 2022, about 2 years ago
Updated 22 September 2023, about 1 year ago

Problem/Motivation

The new field type is fine if you're starting from scratch, but if you want to add this functionality to an existing site, it seems to me the only way is to add a second field, then write an update hook to transfer all the data, then remove the original field.

Proposed resolution

If there's not an easier way to do this, maybe this can be turned into a feature request to support an "allow override" option somewhere for the standard Media reference.

πŸ’¬ Support request
Status

Active

Version

1.0

Component

User interface

Created by

πŸ‡¨πŸ‡¦Canada kpaxman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    This is fantastic. Was looking for how to convert existing media fields to media with contextual modifications!

    A note for others who may make the same mistake i made. If you get:

    [ERROR] Not an entity reference field

    [OK] Migration complete.

    And run you are quite certain the field is indeed an entity reference field, check that you are indeed first putting the entity type, not the bundle, so for example if you have a field on the page content type you want to run drush media_library_media_modify:migrate node field_image and not have 'page' instead of node; field storage can be on multiple node types not only on one at a time, that's why this works this way.

Production build 0.71.5 2024