?
avatar Quy
Quy
6 May 2021

Steps to reproduce the issue

Go to System > Redirects
Click Redirect System Plugin link.
See browser's console.

Actual result

Uncaught TypeError: this._element is undefined modal.js:538:5

avatar Quy Quy - open - 6 May 2021
avatar joomla-cms-bot joomla-cms-bot - change - 6 May 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 May 2021
avatar dgrammatiko
dgrammatiko - comment - 6 May 2021

@Quy can you confirm that the markup is something similar to this (the important bit is the data-bs-toggle here):

Screenshot 2021-05-06 at 18 47 35

It works fine here without any errors so maybe you are using a language that has not updated the string yet?

avatar Quy
Quy - comment - 6 May 2021

Same as yours except for the attributes order.

33579

avatar Quy
Quy - comment - 6 May 2021

It appears to be an issue when no entries (empty state).

avatar dgrammatiko
dgrammatiko - comment - 6 May 2021

It appears to be an issue when no entries (empty state).

Ok, I will check where that could be failing

Edit: so there's a flaw in the empty state pages. The empty page overrides completely the default layout which in this case skips the rendering of the markup for the Modal and also skips loading the appropriate scripts. @PhilETaylor can we move the call for the empty page layout inside the default layout with the appropriate conditional? The other solution is to also pass the modal markdown to the empty page layout (less ideal as it won't be overridable). Another solution is to refactor the whole Modal factory but this is a bit bigger scope...

avatar PhilETaylor
PhilETaylor - comment - 6 May 2021

or just change the link to be /administrator/index.php?option=com_plugins&filter[search]=System%20-%20Redirect

avatar dgrammatiko
dgrammatiko - comment - 6 May 2021

or just change the link to be /administrator/index.php?option=com_plugins&filter[search]=System%20-%20Redirect

Actually, the link right now opens a modal for editing the state so you don't have to navigate away and come back. I don't mind changing the href but I guess there will be ppl that will complain that we destroying Joomla, etc... ?

avatar PhilETaylor
PhilETaylor - comment - 6 May 2021

Modals within modals on mobile soon break this workflow :)

avatar PhilETaylor
PhilETaylor - comment - 6 May 2021

There was a modal thing in empty state, forget which view its in... one mo

avatar PhilETaylor
PhilETaylor - comment - 6 May 2021

Search Joomla for "formAppend" and you will see the example where I had to append 'bootstrap.renderModal' for com_redirect

here:

$displayData['formAppend'] = HTMLHelper::_(

avatar PhilETaylor
PhilETaylor - comment - 6 May 2021

@PhilETaylor can we move the call for the empty page layout inside the default layout with the appropriate conditional?

No. This is how I did it originally - and it lasted a few hours before @Bakual came along and said "lets use a layout instead" :-)

avatar dgrammatiko
dgrammatiko - comment - 6 May 2021

No. This is how I did it originally

I think we need to bring this bac, the modal for this link is rendered here:

<?php if ($this->redirectPluginId) : ?>
<?php $link = Route::_('index.php?option=com_plugins&client_id=0&task=plugin.edit&extension_id=' . $this->redirectPluginId . '&tmpl=component&layout=modal'); ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'plugin' . $this->redirectPluginId . 'Modal',
array(
'url' => $link,
'title' => Text::_('COM_REDIRECT_EDIT_PLUGIN_SETTINGS'),
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'closeButton' => false,
'backdrop' => 'static',
'keyboard' => false,
'footer' => '<button type="button" class="btn" data-bs-dismiss="modal"'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#closeBtn\'})">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" class="btn btn-primary" data-bs-dismiss="modal" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#saveBtn\'})">'
. Text::_("JSAVE") . '</button>'
. '<button type="button" class="btn btn-success" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#applyBtn\'}); return false;">'
. Text::_("JAPPLY") . '</button>'
)
); ?>
<?php endif; ?>

avatar PhilETaylor
PhilETaylor - comment - 6 May 2021

haha :)

avatar Bakual
Bakual - comment - 6 May 2021

Umm, just add that part also to the emptystate layout of com_redirect. What is the problem? We do the same already for the batch modal.

avatar PhilETaylor
PhilETaylor - comment - 6 May 2021

Already one step ahead :)

Screenshot 2021-05-06 at 19 35 13

avatar Bakual
Bakual - comment - 6 May 2021

Faster: #33588 :-p

avatar PhilETaylor
PhilETaylor - comment - 6 May 2021

Screenshot 2021-05-06 at 19 36 31

RTC quick ;-)

avatar Bakual
Bakual - comment - 6 May 2021

Details :-p

avatar Quy Quy - change - 6 May 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-05-06 18:54:34
Closed_By Quy
avatar Quy Quy - close - 6 May 2021
avatar Quy
Quy - comment - 6 May 2021

PR #33588. Thanks.

Add a Comment

Login with GitHub to post a comment