- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
✨ Add "Licence / Source" field to all media entities Active is related, but that should be a separate field.
Added and configured the new field in our preset @anybody, but I can't delete the old field_image_caption because the fields are locked, and I don't want to perform CEX/CIM at this state.
Drush or Devel PHP?
- Status changed to Needs work
8 months ago 12:15pm 26 April 2024 - 🇩🇪Germany Anybody Porta Westfalica
@thomas.frobieter we had
field_image_caption
existing for slides butfield_caption
is not present on slides.Now that we'll remove field_image_caption what's the plan for slides?
Now that we'll remove field_image_caption what's the plan for slides?
Since 4.x is backwards compatible, we might need a database update, wouldn't we?
Otherwise, all existing media slide overlay texts are gone.
- Assigned to Grevil
- 🇩🇪Germany Anybody Porta Westfalica
@Grevil: Can you implement the update hook by time?
See #10. The field only existed in slides. The update hook should also remove the field programmatically then. In our Vorlage I already removed it manually to proceed. So should only execute if it's present, otherwise all good. Our Vorlage had no important existing values for that.
- 🇩🇪Germany Anybody Porta Westfalica
@thomas.frobieter: We must be careful, for Slides the field_image_caption field is labeled "Overlay-Text"!
Should we keep that label?@Grevil: The update script is more important than I had thought before. As @thomas.frobieter wrote, we'll need this for upgradability from 3.x to 4.x
The update script needs to perform the following tasks for the affected media types:
- Check if field_caption already exists. If no, create it as a copy of field_image_caption. If it already exists, skip this steps (this is the case in our preset). The new field should have the same weight as the old field in form and display. [field / config migration]
- Loop all entities of the affected media types and check if both field_image_caption and field_caption exist on the media type. If yes, copy the values from field_image_caption to field_caption [data migration]
- If field_image_caption exists, remove it. [cleanup]
Important notes:
- In our Vorlage, the steps were already taken manually to speed things up and not block us. The update hook should not break things there.
- The newly added field_caption in documents doesn't have to be considered, but we'll need to newly create it programmatically here: ✨ [4.x] Add field_caption for Documents Needs work , I think by importing the config and setting the field weights in display programmatically afterwards. See the other issue, you may want to do that after this issue.
-
thomas.frobieter →
committed 2686b672 on 4.x
Issue #3353768 by Anybody, thomas.frobieter, Grevil: [4.x] Unify image:...
-
thomas.frobieter →
committed 2686b672 on 4.x
@thomas.frobieter: We must be careful, for Slides the field_image_caption field is labeled "Overlay-Text"!
Should we keep that label?We should, because the other fields are also named like this and "Caption" would be kind of misleading here.