ReferenceError: clickmap is not defined making graphical pain form not load?

tylamb19 wrote on Thursday, April 23, 2015:

Hello all,

After a successful new installation, I loaded up the graphical pain form and tried to get it to work, but I keep running into this problem. There seems to be nothing wrong on the server side, logs don’t hint at anything bad (nothing but warnings) but Firefox’s console tells me “ReferenceError: clickmap is not defined” when loading up the form. The form is no longer usable because when you click, nothing happens. The console tells me that the code lies on line 196, column 2 of the file “load_form.php” but there is no line 196. I looked through the code for clickmap and found that it was in another file that matched Firefox’s rendering of it. The code is:

$(document).ready( function() {
                $("#cancel").click(function() { location.href=cancellink; });
		var optionsLabel = 'Pain Scale';
		var options = ["None","Level 1","Level 2","Level 3","Level 4","Moderate","Level 6","Level 7","Level 8","Level 9","Worst Possible"];
		var data = null;
		var hideNav = false;

		clickmap( {
                        hideNav: hideNav,
                        data: data,
			dropdownOptions: { label: optionsLabel, options: options },
			container: $("#container")
		}) ;
	});

Thanks for any help that you are able to provide.

mdsupport wrote on Thursday, April 23, 2015:

Just enabled the form in demo and tried it without any issues. Could it be as simple as pop-up blocker?

fsgl wrote on Thursday, April 23, 2015:

It’s also fine in the 4.2.0 Demo with Firefox 37.0.1.

We presume that Graphic Pain Map was installed as described here & in the accompanying video.

Note that the form is already in Forms Administration but not registered nor enabled by default.

The file that is the closest to your script is openemr/interface/forms/painmap/C_FormPainMap.class.php.

Two files in openemr/interface/clickmap are C_AbstractClickmap.php & AbstractClickmapModel.php.

Last time a file was corrupted. Possibility again?

tmccormi wrote on Thursday, April 23, 2015:

What version of firefox are you using, I ask because a new one just got released and we have found some things that don’t work in NewCrop as a result of that…

tylamb19 wrote on Thursday, April 23, 2015:

Last time a file was corrupted. Possibility again?

I have replaced the files in the painmap folder with ones from a fresh 4.2.0 download. I will try the other two files that you listed once I get a chance.

What version of firefox are you using?

I am using Firefox 37.0.2. Is this the one that doesn’t work? I think I might have updated last night.

-----------------------UPDATE-----------------------------

Just enabled the form in demo and tried it without any issues.

It’s also fine in the 4.2.0 Demo with Firefox 37.0.1.

We have found some things that don’t work in NewCrop because of it

The demo does not work for me! It returns the same error in the same place in the file.

-----------------------UPDATE NUMBER 2---------------------
Safari works. No errors, and the pop-up shows correctly. There’s something screwy with Firefox.

fsgl wrote on Friday, April 24, 2015:

Updated to Firefox 37.0.2, no problem with 4.2.0(1) Demo or localhost.