Problem/Motivation
While we were writing a test (a functional JS test, not an update path test: this is from \Drupal\Tests\media\FunctionalJavascript\CKEditorIntegrationTest::testDialogAccess()
), we noticed that changing a setting on a configurable field did not have any effect:
// Test that setting the media image field to not display alt field also
// disables it in the dialog.
FieldConfig::loadByName('media', 'image', 'field_media_image')
->setSetting('alt_field', FALSE);
->save();
did not cause the alt
setting to be FALSE
.
The solution was adding:
$this->container
->get('cache.discovery')
->delete('entity_bundle_field_definitions:media:image:en');
See #2994702-92: Allow editors to alter embed-specific metadata, as well as `data-align` and `data-caption`
(comments 92 and 93)
Proposed resolution
Remove the need for
$this->container
->get('cache.discovery')
->delete('entity_bundle_field_definitions:media:image:en');
Remaining tasks
TBD
User interface changes
None.
API changes
None.
Data model changes
None.