?
avatar Razzo1987
Razzo1987
22 Aug 2020

Steps to reproduce the issue

  1. Create a custom module
  2. Go to "Options" tab
  3. Select a Background Image
  4. Try to select a different image (the modal doesn't appear)
  5. Remove the image with the X button
  6. Try to select an image (the modal doesn't appear)

Expected result

You can change the image

Actual result

The modal doesn't appear
image

System information (as much as possible)

Nightly Joomla of Saturday, 22 August 2020 02:00:33 UTC
Firefox 79.0 (64 bit) @ Ubuntu 20.04
Chrome 84.0.4147.125 (Build ufficiale) (a 64 bit) @ Ubuntu 20.04

Additional comments

I create a custom module with 2 image and another module with repeatable filed with media.
After you select an image the other image can't selected (images for different fields, but the same page).

avatar Razzo1987 Razzo1987 - open - 22 Aug 2020
avatar joomla-cms-bot joomla-cms-bot - change - 22 Aug 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Aug 2020
avatar Razzo1987 Razzo1987 - change - 22 Aug 2020
The description was changed
avatar Razzo1987 Razzo1987 - edited - 22 Aug 2020
avatar Razzo1987 Razzo1987 - change - 22 Aug 2020
The description was changed
avatar Razzo1987 Razzo1987 - edited - 22 Aug 2020
avatar dgrammatiko
dgrammatiko - comment - 23 Aug 2020

I can't replicate, can you please share if you have any console errors in the browser?

avatar infograf768
infograf768 - comment - 23 Aug 2020

Confirmed.
Uncaught TypeError: this.querySelector(...) is null show http://localhost:8888/sample/joomla40/media/system/js/fields/joomla-field-media.min.js:1

in the non minified file
joomla-field-media.js:252:12

avatar dgrammatiko
dgrammatiko - comment - 23 Aug 2020

@infograf768 can you please enable debug to get the line number that throws the error?

avatar infograf768
infograf768 - comment - 23 Aug 2020

this.querySelector('[role="dialog"]').open();

avatar dgrammatiko
dgrammatiko - comment - 23 Aug 2020

can you try this:

    show() {
      const button = this.querySelector(this.buttonSaveSelected);
      const modal = `imageModal_${this.input.id}`;
      const modalElement = this.querySelector(modal);

      if (!button || !modalElement) {
        throw new Error('Misconfiguaration...');
      }

      modalElement.open();

      Joomla.selectedFile = {};

      button.addEventListener('click', this.onSelected);
    }

build/media_source/system/js/fields/joomla-field-media.w-c.es6.js around line 194

avatar infograf768
infograf768 - comment - 23 Aug 2020

To replace entirely

    show() {
      this.querySelector('[role="dialog"]').open();

      Joomla.selectedFile = {};

      this.querySelector(this.buttonSaveSelected).addEventListener('click', this.onSelected);
    }

??

avatar dgrammatiko
dgrammatiko - comment - 23 Aug 2020

yes, replace the whole show function

avatar infograf768
infograf768 - comment - 23 Aug 2020

Uncaught Error: Misconfiguaration...

avatar infograf768
infograf768 - comment - 23 Aug 2020

have to go. will be back later.

avatar dgrammatiko
dgrammatiko - comment - 23 Aug 2020

Please test #30455

avatar alikon alikon - change - 23 Aug 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-08-23 10:13:39
Closed_By alikon
avatar alikon alikon - close - 23 Aug 2020

Add a Comment

Login with GitHub to post a comment