Since 3.4.4 Joomla started to produce a "too much recursion" JavaScript error with core.js file in ALL my components, which use this code:
Joomla.submitbutton = function(task)
{
if (task == 'sometask') {
if (confirm("Do you really want to do this?")) {
submitbutton(task);
}
} else {
submitbutton(task);
}
}
This code worked perfectly for YEARS, but now it's broken. It actually was taken from some standard Joomla component lately.
Error pops, when you click a button on toolbar (Edit, Publish, Unpublish etc). All buttons are created using standard Joomla JToolBarHelper class.
Looks like an issue to me.
Nice... So I should update all my components due to this doubtful "deprecation". Very smart.
Will Joomla.submitform(task) work for older versions of Joomla or should I add another version check just for this?
Sorry for disappoint you, but submitbutton()
deprecated since Joomla 2.5 and Joomla.submitbutton
, Joomla.submitform
added since then .. or maybe even in Joomla 1.6 ..
Also your original code is incorrect ...
so I wonder why you wonder
I wonder, because it worked perfectly upto 3.4.3.
Joomla.submitbutton and Joomla.submitform
are indeed present in 1.6.0 ;)
there was some changes in core.js
in 3.4.x,
I guess that changes have uncovered your bug
I know it is a bit confused, because there no explanation,
but correct usage is to call submitform()
inside submitbutton()
.. but do not call submitbutton()
inside submitbutton()
...
no matter it is Joomla.submitbutton()
(Joomla.submitform()
) or old submitbutton()
(submitform()
)
Thank you @Fedik for the explanation. I will close this issue since the code was used incorrectly even before the changes in the core.js
. @thekrotek Please update the code in your extensions!
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-09-11 10:00:53 |
Closed_By | ⇒ | Kubik-Rubik |
submitbutton()
is deprecated and internally useJoomla.submitbutton
.. so you got recursion,Correct code is: