on the node edit page contextmod only shows global values for media items even though some are overridden

Created on 13 October 2023, over 1 year ago

Problem/Motivation

For testing purposes I've added three plain text fields to the image media type. On the manage form display and manage display tab I've enabled those three fields for the media library view mode. But it looks like that the three text fields always show the global field values of the media item on the node edit page even if some of the fields are overridden. In contrast in the override media item overlay and in the front end in olivero the overridden values are correctly shown:

override media item overlay:

node edit page:

node in the frontend:
3

Steps to reproduce

- add three plain text fields at /admin/structure/media/manage/image/fields
- enable the created fields on /admin/structure/media/manage/image/form-display/media_library and /admin/structure/media/manage/image/display/media_library
- create a new article node that has the contextmod field added
- add the media items to the node
- save the node
- reopen the node and edit one of the media items and override one of it's fields.
. go back to the node edit page

=> the preview isnt showing the overridden value instead the global value of the media item is shown

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

User interface

Created by

🇩🇪Germany rkoller Nürnberg, Germany

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

Comments & Activities

  • Issue created by @rkoller
  • 🇩🇪Germany rkoller Nürnberg, Germany

    I've did some more digging. Is it possible from my none developer perspective that the current behavior is working as designed on the node edit page for a node containing a Media with contextual modifications field type?
    There are visually hidden input elements after the rendered media library items that look like they are build by media_library_media_modify. But it seems that the media library items before are build in line 397 in the medialibrarywidget.php file with $preview = $view_builder->view($media_item, 'media_library'); and that there is currently no way to have alternative view displays (according to the comment in line 396 pointing to Allow the MediaLibraryUiBuilder service to use an alternative view display Needs work )?

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India chandravilas Pune

    I am also face similar issue, I added a reference field media and selected the widget "Media Library Extra" in a form display, Upload and selection of existing media works fine,
    but issue when I click on edit button, pupup opens, once popup open I modified the existing form and saved, Popup get closed but values are not updated on frontend display on node edit form.

    I solved this issue and created patch for the same, hope attached form helps you.

  • 🇩🇪Germany rkoller Nürnberg, Germany

    i've restored the removed issue summary. why it got removed? next i will see if the issue still applies, and after that i'll take a look at the patch.

  • 🇩🇪Germany rkoller Nürnberg, Germany
  • 🇩🇪Germany rkoller Nürnberg, Germany

    I've tested the steps to reproduce against 2.x-dev again. the problem still applies. changing the version to 2.x-dev. in regard to the patch. would it be possible to move it to a MR and does the changes apply to 2.x-dev as well or are there additional changes necessary?

  • 🇩🇪Germany rkoller Nürnberg, Germany
  • 🇩🇪Germany rkoller Nürnberg, Germany

    hm took the time to install an old drupal 10 site and so being able to install media library media modify 1.x. that way i was able to apply the patch with composer patches. but on the node edit page still the global field value instead of the overridden one is shown. unfortunately the patch isnt fixing the problem outlined in the issue summary. :( i am setting the issue back to needs work.

Production build 0.71.5 2024