2 module same page conflict send list mandatory field

1 year 7 months ago #1 by Francesco
I have 2 myshortlist modules.
One is setted as button and the other one is setted as list.
The first module setted ad button allow user to "like" an article, meanwhile the second module display a list of "liked" articles and also allow user to send list.
If I try to send the list without filling the mandatory email address, I got this error in console:

ReferenceError: Joomla is not defined script.min.js:1:8442
msl_checkRequiredFields XXXX/modules/mod_myshortlist/assets/script.min.js:1
jQuery 2
msl_checkRequiredFields XXXX/modules/mod_myshortlist/assets/script.min.js:1
onsubmit XXXX/yyyy/zzzzzzzz:1

It seems that this is related to the fact that 2 modules are on the same page.

is this a bug?

Please Log in or Create an account to join the conversation.

1 year 7 months ago #2 by Christopher Mavros
Replied by Christopher Mavros on topic 2 module same page conflict send list mandatory field
Hi Francesco and thank you for posting!

This error is probably not related to having two instances of the module in the same page.
The console error that says "Joomla is not defined" indicates that either the media/system/js/core.js file is not included in your page, or some other error has occured before reaching MyShortlist code.

The core.js file is automatically included in every Joomla website, when the template calls <jdoc:include type="head"/>. (and every template must do that)
The only reason why this error would happen in a Joomla site, would be if either your template or another extension you're using deliberately removes the core.js file.

Can you please post a URL to check?
Thanks again!

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

Please Log in or Create an account to join the conversation.

Moderators: Christopher Mavros