Joomla-cms: media modal is not showing in formfield repeatable

Created on 9 May 2017  路  14Comments  路  Source: joomla/joomla-cms

Steps to reproduce the issue

You need a form.xml with type repeatable. In it a type media.

EXAMPLE:

<field name="gallery_news"
    type="repeatable"
    icon="list"
    description="KICKCCK_FIELD_NEWS_GALLERY_LABEL"
    label="KICKCCK_FIELD_NEWS_GALLERY_DESC"
    default=""
    maximum="9"
    >
                <fields name="params">
                    <fieldset hidden="true" name="list_news_gallery" repeat="true">
                        <field  name="gallery_image"
                                type="media"
                                directory="newsimage"
                                label="KICKCCK_FIELD_NEWS_GALLERYIMAGE_LABEL"
                                description="KICKCCK_FIELD_NEWS_GALLERYIMAGE_DESC"
                                preview="true"
                        />
                        <field name="gallery_alt" type="text"
                               size="40" label="KICKCCK_FIELD_NEWS_GALLERY_ALT_LABEL"
                               description="KICKCCK_FIELD_NEWS_GALLERY_ALT_DESC"
                        />
                        <field  name="gallery_lightbox"
                                type="radio"
                                default="1"
                                label="KICKCCK_FIELD_NEWS_GALLERY_LIGHTBOX_LABEL"
                                description="KICKCCK_FIELD_NEWS_GALLERY_LIGHTBOX_DESC"
                        >
                            <option value="0">JNO</option>
                            <option value="1">JYES</option>
                        </field>
                    </fieldset>
                </fields>
            </field>

If you click on Select Image Button it dosen't open the Modal Window with the com_media component.

I know the type repeatable ist deprecated. The PROBLEM is the ISIS Backend Template.

Rename these file and it works.

Maybe these file need an update

Expected result

Actual result

System information (as much as possible)

Joomla 3.7

Additional comments

No Code Attached Yet

Most helpful comment

HI ,
I have the same problem occurred. Now I have fixed my problem.
Below are the steps
Go to the below directory
administrator\templatesisis\html\layouts\joomlaform\field
and remove/rename "media.php"

All 14 comments

Problem being is BS2 doesn't support multiple modals being open at once. I believe this was one of the reasons why subform fields were created.

The problem is that JQuery live problem with the DOM.

I add these CODE to repeatabel.js

// fix media field in ISIS Template
            $row.find('.field-media-wrapper').each(function(){
                var $el = $(this);
                $el.fieldMedia();
            });

I can confirm this issue. It's rather frustrating that things were working perfectly fine in Joomla 3.6.5 and then once update to 3.7.x the "Select" button does not work anymore.

screen shot 2017-05-25 at 7 43 10 pm

System Information

Joomla 3.7.2
PHP 7.0.8

Again, this media field inside a repeatable field worked just fine in Joomla 3.6.5.

Can confirm this for latest Joomla! 3.7.2, with 3.6 it worked. Above hack by @nielsnuebel (inserting code into repeatable.js) fixed the problem. Shouldn't we create a PR for this?

Please do create the PR.

Hi, at wicth line into repeatable.js i had to add nielsnuebel's code? beacuse i add it at the end (before "})(jQuery);") and it not works. Can you help me please? (Sorry for my poor english)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15917.

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/15917

closed as having PR #17205


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15917.

HI ,
I have the same problem occurred. Now I have fixed my problem.
Below are the steps
Go to the below directory
administrator\templatesisis\html\layouts\joomlaform\field
and remove/rename "media.php"

@jinbullsushil can you please test #17205?

The solution proposed by @jinbullsushil solves the problem perfectly.

Why has the bug not yet been solved officially since the solution was proposed in August?

@fede91it - A PR has been submitted, so please feel free to test and mark your result.

https://github.com/joomla/joomla-cms/pull/17205

2 successfull tests are required for it to be merged.

Else if it doesn't work, you could submit a new PR to remove that file as suggested by @jinbullsushil

The PR #17205 is no longer working with a repeatable field + modal_article-field. Tested on Joomla V3.8.8

      <!-- Fieldset: Dock -->
      <fieldset name="dock" label="Dock">

        <field name="dock_links" type="repeatable" icon="link" label="Links">
          <fieldset hidden="true" repeat="true" addfieldpath="/administrator/components/com_content/models/fields">
            <field name="name" type="text" label="Name" description="Social Name" filter="text"/>
            <field 
              name="article"
              type="modal_article"
              label="Select an article"
              select="true"
              edit="false"
              clear="true"
            />
          </fieldset>
        </field>

      </fieldset>
      <!-- ./Fieldset: Dock -->

@muuvmuuv can you please open a new Issue as Comments on closed Issues didn't get much Notice.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brianteeman picture brianteeman  路  6Comments

B3nito picture B3nito  路  5Comments

uglyeoin picture uglyeoin  路  5Comments

wilsonge picture wilsonge  路  4Comments

mbabker picture mbabker  路  4Comments