RTC NPM Resource Changed bug PR-5.1-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
17 Apr 2024

Pull Request for Issue #43289 .

Summary of Changes

The PR add a backward compatibility code to handle buttons for bootstrap modal for Plugin/Module editing.

Testing Instructions

Run npm install.

Add following code, somewhere, example in to index.php of Admin template:

$pluginId = 100; // Id of any existing plugin
$link = Route::_('index.php?option=com_plugins&client_id=0&task=plugin.edit&extension_id=' . $pluginId . '&tmpl=component&layout=modal');

echo HTMLHelper::_(
    'bootstrap.renderModal',
    'plugin' . $pluginId . 'Modal',
    [
        'url'         => $link,
        'title'       => 'Edit',
        'height'      => '400px',
        'width'       => '800px',
        'bodyHeight'  => '70',
        'modalWidth'  => '80',
        'closeButton' => false,
        'backdrop'    => 'static',
        'keyboard'    => false,
        'footer'      => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"'
            . ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $pluginId . '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' . $pluginId . 'Modal\', buttonSelector: \'#saveBtn\'})">'
            . Text::_("JSAVE") . '</button>'
            . '<button type="button" class="btn btn-success" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $pluginId . 'Modal\', buttonSelector: \'#applyBtn\'}); return false;">'
            . Text::_("JAPPLY") . '</button>'
    ]
);

echo HTMLHelper::_('link', '#plugin' . $pluginId . 'Modal', 'Click me', 'class="alert-link" data-bs-toggle="modal"');

It will render bootstrap modal, and link that opens it.

Then click this link, and in the opened modal try to edit any field, and use modal's buttons to save .

Actual result BEFORE applying this Pull Request

Nothing happens (when click "save"), modal just closes (when click "close" or "save and close").

Expected result AFTER applying this Pull Request

The form saved, the modal closes after it.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed

References:

avatar Fedik Fedik - open - 17 Apr 2024
avatar Fedik Fedik - change - 17 Apr 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Apr 2024
Category Administration com_modules com_plugins JavaScript Repository NPM Change
avatar Fedik Fedik - change - 17 Apr 2024
Title
[5.1] Add backward compatibility for bootstrap modals
[5.1] Add backward compatibility for older Plugin/Module bootstrap modals
avatar Fedik Fedik - edited - 17 Apr 2024
avatar Fedik Fedik - change - 17 Apr 2024
The description was changed
avatar Fedik Fedik - edited - 17 Apr 2024
avatar Fedik Fedik - change - 17 Apr 2024
The description was changed
avatar Fedik Fedik - edited - 17 Apr 2024
avatar Fedik Fedik - change - 17 Apr 2024
Labels Added: NPM Resource Changed bug PR-5.1-dev
avatar Ruud68 Ruud68 - test_item - 18 Apr 2024 - Tested successfully
avatar Ruud68
Ruud68 - comment - 18 Apr 2024

I have tested this item ✅ successfully on 23f8389

Tested with Kunena 6.3, works!

Thanks @Fedik for providing this PR.


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

avatar viocassel viocassel - test_item - 22 Apr 2024 - Tested successfully
avatar viocassel
viocassel - comment - 22 Apr 2024

I have tested this item ✅ successfully on 23f8389


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

avatar alikon alikon - change - 22 Apr 2024
Status Pending Ready to Commit
avatar alikon
alikon - comment - 22 Apr 2024

RTC


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

avatar LadySolveig LadySolveig - change - 11 May 2024
Labels Added: RTC
avatar LadySolveig LadySolveig - change - 11 May 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-05-11 11:54:58
Closed_By LadySolveig
avatar LadySolveig LadySolveig - close - 11 May 2024
avatar LadySolveig LadySolveig - merge - 11 May 2024
avatar LadySolveig
LadySolveig - comment - 11 May 2024

Thank you @Fedik and for testing @Ruud68 @viocassel

Add a Comment

Login with GitHub to post a comment