- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
-
+++ b/core/modules/media_library/src/Form/AddFormBase.php @@ -857,4 +858,32 @@ protected function isAdvancedUi() { + $response->addCommand(new ReplaceCommand('[data-drupal-selector="' . $form['#attributes']['data-drupal-selector'] . '"]', $form));
We changed the selector from #media-library-add-form-wrapper (which is outside the form) to the inner form - is that intended?
Do we end up with several nested wrappers?
-
+++ b/core/modules/media_library/src/Form/AddFormBase.php @@ -857,4 +858,32 @@ protected function isAdvancedUi() { + $message = is_array($error) ? reset($error) : (string) $error; + $response->addCommand(new MessageCommand($message, '.media-library-widget-modal [data-drupal-messages-fallback]', ['type' => 'error']));
If it is an array, what happens to the other entries in the array?
-
+++ b/core/modules/media_library/src/Form/AddFormBase.php @@ -857,4 +858,32 @@ protected function isAdvancedUi() { + // The drupal messages fallback defaults to having the .hidden class, but
nit Drupal not drupal
-
+++ b/core/modules/media_library/src/Form/AddFormBase.php @@ -857,4 +858,32 @@ protected function isAdvancedUi() { + // should be visible for this usage.
Why is this the case? It would be good to elaborate a bit more here
-
+++ b/core/modules/media_library/src/Form/AddFormBase.php @@ -857,4 +858,32 @@ protected function isAdvancedUi() { + $response->addCommand(new InvokeCommand('.media-library-widget-modal [data-drupal-messages-fallback]', 'removeClass', ['hidden']));
Drupal.Message.defaultWrapper seems to do this already in messages.js - should we be deferring to that?
-
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php @@ -456,4 +456,22 @@ protected function assertSelectedMediaCount($text) { + return strpos($announce->getText(), $expected_message) !== FALSE;
We can use str_contains here now
-
- Status changed to Needs work
over 1 year ago 12:55am 12 April 2023 - πΊπΈUnited States smustgrave
This actually may need some more thought.
I tested again with the patch but this time using an image field vs media library and this patch. doesn't fix it. Think we should come up with a solution to make sure duplicate messages just don't appear.
@larowlan any suggestion.
At this time changes are not neede for #50 as a new solution is needed