joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.73k stars 3.64k forks source link

Modal links are broken in Joomla 3.10 #35421

Closed Mat-o closed 3 years ago

Mat-o commented 3 years ago

It is usefull sometimes to be able to write simple html links opening in a modal, without php, directly in articles. With Joomla 3.9, this used to work very efficiently :

and a simple modal window would open, displaying the content of the href link (no iframe : the content was pulled and displayed in ajax). It could be a Joomla article, or even an external link. No need for an extension. Now these link are broken after the update from 3.9.28 to 3.10.1 : is there a new syntax I should use ?

Steps to reproduce the issue

1 - create a link : <a class="modal" href="index.php?xxxxxxx&tmpl=component" rel="{handler: 'iframe', size: {x: 600, y: 450}}">Open modal</a>

Expected result

Opens modal.

Actual result

Does no open modal since updating to 3.10.x

System information (as much as possible)

Joomla 3.10.0 after update from 3.9.28. php 7.4, apache 2.4 + nginx as proxy-cache, Mysql 5.7. All browsers behave the same way.

Additional comments

It seems the mootools library was taking care of this, but maybe it has been deprecated now. Does the syntax above miss a data-attribute, or a change in the class name ? Or is there a whole new way to open modals ?

Thank you for making Joomla !

[edit : formating]

drmenzelit commented 3 years ago

As far as I can see nothing changed in Joomla 3.10, the modal behavior was not removed. Which template are you using? Maybe something changed there or on some override, because you need to load JHTML::_('behavior.modal'); to get your code working. I tested on a 3.10 installation adding the modal behavior in Protostar and it worked.

Mootools was removed in J4, so the code above will not work anymore.

Mat-o commented 3 years ago

Thank you, your answer helped me a lot. I was using JHtml::_('bootstrap.framework'); instead of JHTML::_('behavior.modal'); Now the modals are back again. I don't think it shoud be considered a regression, because I was not calling the library correctly in the first place. Maybe others will have the same problem after updating, so I hope this thread can help them.

alikon commented 3 years ago

ok then let's close it