Javascript error in backend since update to 3.0.9 on marker form

Phoca Maps - displaying maps in Joomla! CMS
xillibit
Phoca Member
Phoca Member
Posts: 24
Joined: 26 Jun 2017, 16:25

Javascript error in backend since update to 3.0.9 on marker form

Post by xillibit » 13 Nov 2020, 21:31

Hello,

Since the update to phoca maps 3.0.9, in the marker form in backend, i can't open the modal windows to define the marker position. In browser console i have this error :

Code: Select all

Uncaught SyntaxError: missing ) after argument list at index.php:254:42

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 44015
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Javascript error in backend since update to 3.0.9 on marker form

Post by Jan » 17 Nov 2020, 17:24

Hi, testing now, everything is working OK for me:
Image

(edit an marker, opened modal window)

Are you able to navigate with your javascript error console directly to the code where this occurs? (clicking on error message should link to code)

Do you use OSM or Google Maps?


It is unlikely that the package will be damaged, but try downloading the installation package again and try to reinstall Phoca Maps with the same version :idea:

Jan
If you find Phoca extensions useful, please support the project

xillibit
Phoca Member
Phoca Member
Posts: 24
Joined: 26 Jun 2017, 16:25

Re: Javascript error in backend since update to 3.0.9 on marker form

Post by xillibit » 17 Nov 2020, 19:16

Hello,

I'am using OSM, when i navigate to the code from the console it goes here :

Image

So it seems it doesn'nt likes the quotes in the french translation

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 44015
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Javascript error in backend since update to 3.0.9 on marker form

Post by Jan » 17 Nov 2020, 22:08

Hi, thank you for the info, please open this file:

administrator\components\com_phocamaps\views\phocamapsmarker\tmpl\edit.php

and edit

FROM:

Code: Select all

JFactory::getDocument()->addScriptDeclaration(

'Joomla.submitbutton = function(task) {
	if (task != \''. $this->t['task'].'.cancel\' && document.getElementById(\'jform_catid\').value == \'\') {
		alert(\''.$this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED')) . ' - '. $this->escape(JText::_('COM_PHOCAMAPS_ERROR_MAP_NOT_SELECTED')).'\');
	} else if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
		Joomla.submitform(task, document.getElementById("adminForm"));
	} else {
        Joomla.renderMessages({"error": ["'. JText::_('JGLOBAL_VALIDATION_FORM_FAILED', true).'"]});
	}
}'

);
TO:

Code: Select all

JFactory::getDocument()->addScriptDeclaration(

'Joomla.submitbutton = function(task) {
	if (task != \''. $this->t['task'].'.cancel\' && document.getElementById(\'jform_catid\').value == \'\') {
		alert(\''.JText::_('JGLOBAL_VALIDATION_FORM_FAILED', true) . ' - '. JText::_('COM_PHOCAMAPS_ERROR_MAP_NOT_SELECTED', true).'\');
	} else if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
		Joomla.submitform(task, document.getElementById("adminForm"));
	} else {
        Joomla.renderMessages({"error": ["'. JText::_('JGLOBAL_VALIDATION_FORM_FAILED', true).'"]});
	}
}'

);
This should fix it. Please let me know. I will change it for next version.

Thank you, Jan
If you find Phoca extensions useful, please support the project

xillibit
Phoca Member
Phoca Member
Posts: 24
Joined: 26 Jun 2017, 16:25

Re: Javascript error in backend since update to 3.0.9 on marker form

Post by xillibit » 17 Nov 2020, 23:04

I have applied this change, it works

Thanks

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 44015
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Javascript error in backend since update to 3.0.9 on marker form

Post by Jan » 18 Nov 2020, 00:00

Great to hear it, I will change it for next version.

Thank you, Jan
If you find Phoca extensions useful, please support the project

Post Reply