Skip to content
Snippets Groups Projects
Commit 675d0495 authored by catch's avatar catch
Browse files

Issue #3388913 by simonp98, Rajab Natshah, SoulReceiver, catch, smustgrave:...

Issue #3388913 by simonp98, Rajab Natshah, SoulReceiver, catch, smustgrave: Checkbox for Media library modal missing after search

(cherry picked from commit 9bfa224a)
parent 3de6ac2e
No related branches found
No related tags found
27 merge requests!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!10602Issue #3438769 by vinmayiswamy, antonnavi, michelle, amateescu: Sub workspace does not clear,!10301Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...,!10187Issue #3487488 by dakwamine: ExtensionMimeTypeGuesser::guessMimeType must support file names with "0" (zero) like foo.0.zip,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!9929Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9787Resolve issue 3479427 - bootstrap barrio issue under Windows,!9742Issue #3463908 by catch, quietone: Split OptionsFieldUiTest into two,!9526Issue #3458177 by mondrake, catch, quietone, godotislate, longwave, larowlan,...,!8738Issue #3424162 by camilledavis, dineshkumarbollu, smustgrave: Claro...,!8704Make greek characters available in ckeditor5,!8597Draft: Issue #3442259 by catch, quietone, dww: Reduce time of Migrate Upgrade tests...,!8533Issue #3446962 by kim.pepper: Remove incorrectly added...,!8517Issue #3443748 by NexusNovaz, smustgrave: Testcase creates false positive,!8325Update file Sort.php,!8095Expose document root on install,!7930Resolve #3427374 "Taxonomytid viewsargumentdefault plugin",!7627Issue #3439440 by nicxvan, Binoli Lalani, longwave: Remove country support from DateFormatter,!7445Issue #3440169: When using drupalGet(), provide an associative array for $headers,!7401#3271894 Fix documented StreamWrapperInterface return types for realpath() and dirname(),!7384Add constraints to system.advisories,!7078Issue #3320569 by Spokje, mondrake, smustgrave, longwave, quietone, Lendude,...,!6622Issue #2559833 by piggito, mohit_aghera, larowlan, guptahemant, vakulrai,...,!6502Draft: Resolve #2938524 "Plach testing issue",!38582585169-10.1.x,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key
Pipeline #117372 passed
Pipeline: drupal

#117393

    Pipeline: drupal

    #117388

      Pipeline: drupal

      #117382

        +1
        ...@@ -28,7 +28,34 @@ class MediaLibrarySelectForm extends FieldPluginBase { ...@@ -28,7 +28,34 @@ class MediaLibrarySelectForm extends FieldPluginBase {
        * {@inheritdoc} * {@inheritdoc}
        */ */
        public function getValue(ResultRow $row, $field = NULL) { public function getValue(ResultRow $row, $field = NULL) {
        return '<!--form-item-' . $this->options['id'] . '--' . $row->index . '-->'; return '<!--form-item-' . $this->options['id'] . '--' . $row->mid . '-->';
        }
        /**
        * Return the name of a form field.
        *
        * @see \Drupal\views\Form\ViewsFormMainForm
        *
        * @return string
        * The form field name.
        */
        public function form_element_name(): string {
        return $this->field;
        }
        /**
        * Return a media entity ID from a views result row.
        *
        * @see \Drupal\views\Form\ViewsFormMainForm
        *
        * @param int $row_id
        * The index of a views result row.
        *
        * @return string
        * The ID of a media entity.
        */
        public function form_element_row_id(int $row_id): string {
        return $this->view->result[$row_id]->mid;
        } }
        /** /**
        ...@@ -70,7 +97,7 @@ public function viewsForm(array &$form, FormStateInterface $form_state) { ...@@ -70,7 +97,7 @@ public function viewsForm(array &$form, FormStateInterface $form_state) {
        $form[$this->options['id']][$row_index] = []; $form[$this->options['id']][$row_index] = [];
        continue; continue;
        } }
        $form[$this->options['id']][$row_index] = [ $form[$this->options['id']][$row->mid] = [
        '#type' => 'checkbox', '#type' => 'checkbox',
        '#title' => $this->t('Select @label', [ '#title' => $this->t('Select @label', [
        '@label' => $entity->label(), '@label' => $entity->label(),
        ......
        ...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
        use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldConfig;
        use Drupal\field\Entity\FieldStorageConfig; use Drupal\field\Entity\FieldStorageConfig;
        use Drupal\FunctionalJavascriptTests\WebDriverTestBase; use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
        use Drupal\media\Entity\Media;
        use Drupal\Tests\TestFileCreationTrait; use Drupal\Tests\TestFileCreationTrait;
        /** /**
        ...@@ -136,10 +137,13 @@ public function testInsertionAndReselection($widget) { ...@@ -136,10 +137,13 @@ public function testInsertionAndReselection($widget) {
        return $wrapper->hasButton('Add media'); return $wrapper->hasButton('Add media');
        }); });
        // Test reinserting the same selection. // Test reinserting the same selection.
        $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items);
        $added_media_id = $added_media->id();
        $wrapper->pressButton('Add media'); $wrapper->pressButton('Add media');
        $this->assertNotNull($assert_session->waitForText('Add or select media')); $this->assertNotNull($assert_session->waitForText('Add or select media'));
        $assert_session->elementExists('xpath', "(//div[contains(@class, 'media-library-item')])[1]")->click(); $assert_session->elementExists('xpath', "(//div[contains(@class, 'media-library-item')])[1]")->click();
        $assert_session->checkboxChecked('media_library_select_form[0]'); $assert_session->checkboxChecked("media_library_select_form[$added_media_id]");
        $assert_session->elementExists('css', '.ui-dialog-buttonpane')->pressButton('Insert selected'); $assert_session->elementExists('css', '.ui-dialog-buttonpane')->pressButton('Insert selected');
        $this->assertNotNull($assert_session->waitForElementVisible('xpath', $first_item_locator)); $this->assertNotNull($assert_session->waitForElementVisible('xpath', $first_item_locator));
        } }
        ......
        ...@@ -97,14 +97,15 @@ public function testWidgetOEmbed() { ...@@ -97,14 +97,15 @@ public function testWidgetOEmbed() {
        // Load the created media item. // Load the created media item.
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_id = $added_media->id();
        // Ensure the media item was saved to the library and automatically // Ensure the media item was saved to the library and automatically
        // selected. The added media items should be in the first position of the // selected. The added media items should be in the first position of the
        // add form. // add form.
        $assert_session->pageTextContains('Add or select media'); $assert_session->pageTextContains('Add or select media');
        $assert_session->pageTextContains($youtube_title); $assert_session->pageTextContains($youtube_title);
        $assert_session->fieldValueEquals('media_library_select_form[0]', $added_media->id()); $assert_session->fieldValueEquals("media_library_select_form[$added_media_id]", $added_media_id);
        $assert_session->checkboxChecked('media_library_select_form[0]'); $assert_session->checkboxChecked("media_library_select_form[$added_media_id]");
        // Assert the created oEmbed video is correctly added to the widget. // Assert the created oEmbed video is correctly added to the widget.
        $this->pressInsertSelected('Added one media item.'); $this->pressInsertSelected('Added one media item.');
        ...@@ -158,19 +159,20 @@ public function testWidgetOEmbed() { ...@@ -158,19 +159,20 @@ public function testWidgetOEmbed() {
        // Load the created media item. // Load the created media item.
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_id = $added_media->id();
        // Ensure the media item was saved to the library and automatically // Ensure the media item was saved to the library and automatically
        // selected. The added media items should be in the first position of the // selected. The added media items should be in the first position of the
        // add form. // add form.
        $assert_session->pageTextContains('Add or select media'); $assert_session->pageTextContains('Add or select media');
        $assert_session->pageTextContains('Custom video title'); $assert_session->pageTextContains('Custom video title');
        $assert_session->fieldValueEquals('media_library_select_form[0]', $added_media->id()); $assert_session->fieldValueEquals("media_library_select_form[$added_media_id]", $added_media_id);
        $assert_session->checkboxChecked('media_library_select_form[0]'); $assert_session->checkboxChecked("media_library_select_form[$added_media_id]");
        // Assert the item that was selected before uploading the file is still // Assert the item that was selected before uploading the file is still
        // selected. // selected.
        $assert_session->pageTextContains('2 items selected'); $assert_session->pageTextContains('2 items selected');
        $assert_session->checkboxChecked("Select Custom video title"); $assert_session->checkboxChecked("Select Custom video title");
        $assert_session->checkboxChecked("Select $youtube_title"); $assert_session->checkboxChecked("Select $youtube_title");
        $assert_session->hiddenFieldValueEquals('current_selection', implode(',', [$selected_item_id, $added_media->id()])); $assert_session->hiddenFieldValueEquals('current_selection', implode(',', [$selected_item_id, $added_media_id]));
        $selected_checkboxes = []; $selected_checkboxes = [];
        foreach ($this->getCheckboxes() as $checkbox) { foreach ($this->getCheckboxes() as $checkbox) {
        if ($checkbox->isChecked()) { if ($checkbox->isChecked()) {
        ...@@ -209,7 +211,7 @@ public function testWidgetOEmbed() { ...@@ -209,7 +211,7 @@ public function testWidgetOEmbed() {
        $this->waitForText('The media item has been created but has not yet been saved'); $this->waitForText('The media item has been created but has not yet been saved');
        $page->fillField('Name', 'Another video'); $page->fillField('Name', 'Another video');
        $this->pressSaveButton(); $this->pressSaveButton();
        $page->uncheckField('media_library_select_form[1]'); $page->uncheckField("media_library_select_form[$selected_item_id]");
        $this->waitForText('1 item selected'); $this->waitForText('1 item selected');
        $this->pressInsertSelected('Added one media item.'); $this->pressInsertSelected('Added one media item.');
        $this->waitForText('Another video'); $this->waitForText('Another video');
        ...@@ -283,14 +285,15 @@ public function testWidgetOEmbedAdvancedUi() { ...@@ -283,14 +285,15 @@ public function testWidgetOEmbedAdvancedUi() {
        // Load the created media item. // Load the created media item.
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_id = $added_media->id();
        // Ensure the media item was saved to the library and automatically // Ensure the media item was saved to the library and automatically
        // selected. The added media items should be in the first position of the // selected. The added media items should be in the first position of the
        // add form. // add form.
        $assert_session->pageTextContains('Add or select media'); $assert_session->pageTextContains('Add or select media');
        $assert_session->pageTextContains($youtube_title); $assert_session->pageTextContains($youtube_title);
        $assert_session->fieldValueEquals('media_library_select_form[0]', $added_media->id()); $assert_session->fieldValueEquals("media_library_select_form[$added_media_id]", $added_media_id);
        $assert_session->checkboxChecked('media_library_select_form[0]'); $assert_session->checkboxChecked("media_library_select_form[$added_media_id]");
        // Assert the created oEmbed video is correctly added to the widget. // Assert the created oEmbed video is correctly added to the widget.
        $this->pressInsertSelected('Added one media item.'); $this->pressInsertSelected('Added one media item.');
        ...@@ -346,19 +349,20 @@ public function testWidgetOEmbedAdvancedUi() { ...@@ -346,19 +349,20 @@ public function testWidgetOEmbedAdvancedUi() {
        // Load the created media item. // Load the created media item.
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_id = $added_media->id();
        // Ensure the media item was saved to the library and automatically // Ensure the media item was saved to the library and automatically
        // selected. The added media items should be in the first position of the // selected. The added media items should be in the first position of the
        // add form. // add form.
        $assert_session->pageTextContains('Add or select media'); $assert_session->pageTextContains('Add or select media');
        $assert_session->pageTextContains('Custom video title'); $assert_session->pageTextContains('Custom video title');
        $assert_session->fieldValueEquals('media_library_select_form[0]', $added_media->id()); $assert_session->fieldValueEquals("media_library_select_form[$added_media_id]", $added_media_id);
        $assert_session->checkboxChecked('media_library_select_form[0]'); $assert_session->checkboxChecked("media_library_select_form[$added_media_id]");
        // Assert the item that was selected before uploading the file is still // Assert the item that was selected before uploading the file is still
        // selected. // selected.
        $assert_session->pageTextContains('2 items selected'); $assert_session->pageTextContains('2 items selected');
        $assert_session->checkboxChecked("Select Custom video title"); $assert_session->checkboxChecked("Select Custom video title");
        $assert_session->checkboxChecked("Select $youtube_title"); $assert_session->checkboxChecked("Select $youtube_title");
        $assert_session->hiddenFieldValueEquals('current_selection', implode(',', [$selected_item_id, $added_media->id()])); $assert_session->hiddenFieldValueEquals('current_selection', implode(',', [$selected_item_id, $added_media_id]));
        $selected_checkboxes = []; $selected_checkboxes = [];
        foreach ($this->getCheckboxes() as $checkbox) { foreach ($this->getCheckboxes() as $checkbox) {
        if ($checkbox->isChecked()) { if ($checkbox->isChecked()) {
        ...@@ -409,10 +413,11 @@ public function testWidgetOEmbedAdvancedUi() { ...@@ -409,10 +413,11 @@ public function testWidgetOEmbedAdvancedUi() {
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_id = $added_media->id();
        $this->waitForText('1 item selected'); $this->waitForText('1 item selected');
        $assert_session->checkboxChecked('Select Another video'); $assert_session->checkboxChecked('Select Another video');
        $assert_session->checkboxNotChecked("Select $vimeo_title"); $assert_session->checkboxNotChecked("Select $vimeo_title");
        $assert_session->hiddenFieldValueEquals('current_selection', $added_media->id()); $assert_session->hiddenFieldValueEquals('current_selection', $added_media_id);
        $this->pressInsertSelected('Added one media item.'); $this->pressInsertSelected('Added one media item.');
        $this->waitForText('Another video'); $this->waitForText('Another video');
        ......
        ...@@ -121,7 +121,7 @@ public function testWidgetUpload() { ...@@ -121,7 +121,7 @@ public function testWidgetUpload() {
        $this->waitForText('Alternative text field is required'); $this->waitForText('Alternative text field is required');
        $page->fillField('Alternative text', $this->randomString()); $page->fillField('Alternative text', $this->randomString());
        $this->pressSaveButton(); $this->pressSaveButton();
        $this->assertJsCondition('jQuery("input[name=\'media_library_select_form[0]\']").is(":focus")'); $this->assertJsCondition('jQuery("input[name=\'media_library_select_form[1]\']").is(":focus")');
        // The file should be permanent now. // The file should be permanent now.
        $files = $file_storage->loadMultiple(); $files = $file_storage->loadMultiple();
        $file = array_pop($files); $file = array_pop($files);
        ...@@ -129,15 +129,16 @@ public function testWidgetUpload() { ...@@ -129,15 +129,16 @@ public function testWidgetUpload() {
        // Load the created media item. // Load the created media item.
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_id = $added_media->id();
        // Ensure the media item was saved to the library and automatically // Ensure the media item was saved to the library and automatically
        // selected. The added media items should be in the first position of the // selected. The added media items should be in the first position of the
        // add form. // add form.
        $assert_session->pageTextContains('Add or select media'); $assert_session->pageTextContains('Add or select media');
        $assert_session->pageTextContains($png_image->filename); $assert_session->pageTextContains($png_image->filename);
        $assert_session->fieldValueEquals('media_library_select_form[0]', $added_media->id()); $assert_session->fieldValueEquals("media_library_select_form[$added_media_id]", $added_media_id);
        $assert_session->checkboxChecked('media_library_select_form[0]'); $assert_session->checkboxChecked("media_library_select_form[$added_media_id]");
        $assert_session->pageTextContains('1 of 2 items selected'); $assert_session->pageTextContains('1 of 2 items selected');
        $assert_session->hiddenFieldValueEquals('current_selection', $added_media->id()); $assert_session->hiddenFieldValueEquals('current_selection', $added_media_id);
        // Ensure the created item is added in the widget. // Ensure the created item is added in the widget.
        $this->pressInsertSelected('Added one media item.'); $this->pressInsertSelected('Added one media item.');
        $this->waitForText($png_image->filename); $this->waitForText($png_image->filename);
        ...@@ -179,19 +180,20 @@ public function testWidgetUpload() { ...@@ -179,19 +180,20 @@ public function testWidgetUpload() {
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_name = $added_media->label(); $added_media_name = $added_media->label();
        $added_media_id = $added_media->id();
        // Ensure the media item was saved to the library and automatically // Ensure the media item was saved to the library and automatically
        // selected. The added media items should be in the first position of the // selected. The added media items should be in the first position of the
        // add form. // add form.
        $assert_session->pageTextContains('Add or select media'); $assert_session->pageTextContains('Add or select media');
        $assert_session->pageTextContains('Unlimited Cardinality Image'); $assert_session->pageTextContains('Unlimited Cardinality Image');
        $assert_session->fieldValueEquals('media_library_select_form[0]', $added_media->id()); $assert_session->fieldValueEquals("media_library_select_form[$added_media_id]", $added_media_id);
        $assert_session->checkboxChecked('media_library_select_form[0]'); $assert_session->checkboxChecked("media_library_select_form[$added_media_id]");
        // Assert the item that was selected before uploading the file is still // Assert the item that was selected before uploading the file is still
        // selected. // selected.
        $assert_session->pageTextContains('2 items selected'); $assert_session->pageTextContains('2 items selected');
        $assert_session->checkboxChecked("Select $added_media_name"); $assert_session->checkboxChecked("Select $added_media_name");
        $assert_session->checkboxChecked("Select $existing_media_name"); $assert_session->checkboxChecked("Select $existing_media_name");
        $assert_session->hiddenFieldValueEquals('current_selection', implode(',', [$selected_item_id, $added_media->id()])); $assert_session->hiddenFieldValueEquals('current_selection', implode(',', [$selected_item_id, $added_media_id]));
        $selected_checkboxes = []; $selected_checkboxes = [];
        foreach ($this->getCheckboxes() as $checkbox) { foreach ($this->getCheckboxes() as $checkbox) {
        if ($checkbox->isChecked()) { if ($checkbox->isChecked()) {
        ...@@ -259,10 +261,11 @@ public function testWidgetUpload() { ...@@ -259,10 +261,11 @@ public function testWidgetUpload() {
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_name = $added_media->label(); $added_media_name = $added_media->label();
        $added_media_id = $added_media->id();
        $assert_session->pageTextContains('1 item selected'); $assert_session->pageTextContains('1 item selected');
        $assert_session->checkboxChecked("Select $added_media_name"); $assert_session->checkboxChecked("Select $added_media_name");
        $assert_session->checkboxNotChecked("Select $existing_media_name"); $assert_session->checkboxNotChecked("Select $existing_media_name");
        $assert_session->hiddenFieldValueEquals('current_selection', $added_media->id()); $assert_session->hiddenFieldValueEquals('current_selection', $added_media_id);
        $this->pressInsertSelected('Added one media item.'); $this->pressInsertSelected('Added one media item.');
        $this->waitForText($file_system->basename($png_uri_5)); $this->waitForText($file_system->basename($png_uri_5));
        ...@@ -461,7 +464,7 @@ public function testWidgetUploadAdvancedUi() { ...@@ -461,7 +464,7 @@ public function testWidgetUploadAdvancedUi() {
        $this->waitForText('Alternative text field is required'); $this->waitForText('Alternative text field is required');
        $page->fillField('Alternative text', $this->randomString()); $page->fillField('Alternative text', $this->randomString());
        $this->saveAnd('select'); $this->saveAnd('select');
        $this->assertJsCondition('jQuery("input[name=\'media_library_select_form[0]\']").is(":focus")'); $this->assertJsCondition('jQuery("input[name=\'media_library_select_form[1]\']").is(":focus")');
        // The file should be permanent now. // The file should be permanent now.
        $files = $file_storage->loadMultiple(); $files = $file_storage->loadMultiple();
        $file = array_pop($files); $file = array_pop($files);
        ...@@ -469,15 +472,16 @@ public function testWidgetUploadAdvancedUi() { ...@@ -469,15 +472,16 @@ public function testWidgetUploadAdvancedUi() {
        // Load the created media item. // Load the created media item.
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_id = $added_media->id();
        // Ensure the media item was saved to the library and automatically // Ensure the media item was saved to the library and automatically
        // selected. The added media items should be in the first position of the // selected. The added media items should be in the first position of the
        // add form. // add form.
        $assert_session->pageTextContains('Add or select media'); $assert_session->pageTextContains('Add or select media');
        $assert_session->pageTextContains($png_image->filename); $assert_session->pageTextContains($png_image->filename);
        $assert_session->fieldValueEquals('media_library_select_form[0]', $added_media->id()); $assert_session->fieldValueEquals("media_library_select_form[$added_media_id]", $added_media_id);
        $assert_session->checkboxChecked('media_library_select_form[0]'); $assert_session->checkboxChecked("media_library_select_form[$added_media_id]");
        $assert_session->pageTextContains('1 of 2 items selected'); $assert_session->pageTextContains('1 of 2 items selected');
        $assert_session->hiddenFieldValueEquals('current_selection', $added_media->id()); $assert_session->hiddenFieldValueEquals('current_selection', $added_media_id);
        // Ensure the created item is added in the widget. // Ensure the created item is added in the widget.
        $this->pressInsertSelected('Added one media item.'); $this->pressInsertSelected('Added one media item.');
        $this->waitForText($png_image->filename); $this->waitForText($png_image->filename);
        ...@@ -523,19 +527,20 @@ public function testWidgetUploadAdvancedUi() { ...@@ -523,19 +527,20 @@ public function testWidgetUploadAdvancedUi() {
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_name = $added_media->label(); $added_media_name = $added_media->label();
        $added_media_id = $added_media->id();
        // Ensure the media item was saved to the library and automatically // Ensure the media item was saved to the library and automatically
        // selected. The added media items should be in the first position of the // selected. The added media items should be in the first position of the
        // add form. // add form.
        $assert_session->pageTextContains('Add or select media'); $assert_session->pageTextContains('Add or select media');
        $assert_session->pageTextContains('Unlimited Cardinality Image'); $assert_session->pageTextContains('Unlimited Cardinality Image');
        $assert_session->fieldValueEquals('media_library_select_form[0]', $added_media->id()); $assert_session->fieldValueEquals("media_library_select_form[$added_media_id]", $added_media_id);
        $assert_session->checkboxChecked('media_library_select_form[0]'); $assert_session->checkboxChecked("media_library_select_form[$added_media_id]");
        // Assert the item that was selected before uploading the file is still // Assert the item that was selected before uploading the file is still
        // selected. // selected.
        $assert_session->pageTextContains('2 items selected'); $assert_session->pageTextContains('2 items selected');
        $assert_session->checkboxChecked("Select $added_media_name"); $assert_session->checkboxChecked("Select $added_media_name");
        $assert_session->checkboxChecked("Select $existing_media_name"); $assert_session->checkboxChecked("Select $existing_media_name");
        $assert_session->hiddenFieldValueEquals('current_selection', implode(',', [$selected_item_id, $added_media->id()])); $assert_session->hiddenFieldValueEquals('current_selection', implode(',', [$selected_item_id, $added_media_id]));
        $selected_checkboxes = []; $selected_checkboxes = [];
        foreach ($this->getCheckboxes() as $checkbox) { foreach ($this->getCheckboxes() as $checkbox) {
        if ($checkbox->isChecked()) { if ($checkbox->isChecked()) {
        ...@@ -634,10 +639,11 @@ public function testWidgetUploadAdvancedUi() { ...@@ -634,10 +639,11 @@ public function testWidgetUploadAdvancedUi() {
        $media_items = Media::loadMultiple(); $media_items = Media::loadMultiple();
        $added_media = array_pop($media_items); $added_media = array_pop($media_items);
        $added_media_name = $added_media->label(); $added_media_name = $added_media->label();
        $added_media_id = $added_media->id();
        $assert_session->pageTextContains('1 item selected'); $assert_session->pageTextContains('1 item selected');
        $assert_session->checkboxChecked("Select $added_media_name"); $assert_session->checkboxChecked("Select $added_media_name");
        $assert_session->checkboxNotChecked("Select $existing_media_name"); $assert_session->checkboxNotChecked("Select $existing_media_name");
        $assert_session->hiddenFieldValueEquals('current_selection', $added_media->id()); $assert_session->hiddenFieldValueEquals('current_selection', $added_media_id);
        $this->pressInsertSelected('Added one media item.'); $this->pressInsertSelected('Added one media item.');
        $this->waitForText($file_system->basename($png_uri_5)); $this->waitForText($file_system->basename($png_uri_5));
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment