HTML editor missing caused by DragMath?

HTML editor missing caused by DragMath?

by Brian Sampson -
Number of replies: 4
Recently, we upgraded to Moodle 1.9.5+. Before upgrading we did not uninstall DragMath (the only plug-in we were currently running). Once the upgrade was complete, we noticed that the HTML editor was missing. After a couple of hours of code searching, we re-installed of dragmath directly from the new zip file (newest version downloaded today). This however, did not alleviate the missing editor problem. It was, however, resolved once I removed the DragMath code from dialog.js file within the HTML area. After removal of the code from this file, I refreshed my browser and the editor was back in place. Knowing that this fixed the editor, I removed the code from the other files that DragMath was in.

I don't know if anyone else has seen any similar issues with DragMath and the HTML editor, but just thought I'd bring this up.

Thanks,

Brian
Average of ratings: -
In reply to Brian Sampson

Re: HTML editor missing caused by DragMath?

by Marc Grober -
A Few of questions for you Brian.

When you did the upgrade to 1.9.5+, from what version did you upgrade and what procedure did you use to upgrade? Did you upgrade over your prior install, or did you do a new install of 1.9.5+ and then move/configure? I am trying to determine the status of your files immediately before and after your installation.

You say you did a dragmath install from the the 0.7.7.1 zip file after upgrade. Did you check to see if there dragmath files present before doing the dragmath install. Do you still have the URL from whence you pulled the dragmath zip? How exactly did you install dragmath from the zip?

When you say you removed dragmath code from dialog.js, can you be a bit more specific? I am a bit confused as to what you did and where you did it. Assuming that you just edited the one file, can you confirm the location of the dialog.js file you edited and possibly zip up and upload your edited version so that I can compare file details?

I understand I asking for a bit, but I'd like to get as much info as possible so that I can try and replicate your experience to try and identify what may have gone awry.
In reply to Marc Grober

Re: HTML editor missing caused by DragMath?

by Brian Sampson -
Hi Marc,

I'll be glad to answer your questions. I hope that it will help with your continued maintenance of DragMath.

We upgraded to 1.9.5+ from 1.9.4. We try to keep a fairly updated server. We are running on a Mac X-Serve. We did upgrade over the prior install using the CSV upgrade command provided within the MAMP folder.

The dragmath files were present within the /lib/editor/htmlarea folder prior to attempting another install of dragmath to see if that would resolve the issue. When re-installing dragmath, I simply installed the same way we previously did by replacing all necessary files within the /lib and sub folders, with the exception of the adminlib.php. I did, however, confirm that the correct update was added to that file so that the icon would show within the administration module for the HTML editor. Although I don't currently have the URL for the download, I did download it directly from moodle.org, and it was updated yesterday.

The dialog.js file, located in /lib/editor/htmlarea, was the file that was altered to correct the issue. When correcting all files containing dragmath pieces, I did a browser refresh after each file, so I'm 99% positive that it was within the dialog.js file that resolved the issue of the missing editor. As for the code I removed, I searched for all instances of dragmath within the file(s) and then removed the lines of code associated with dragmath. Within the dialog.js file, there was acutally just one line of code removed...

line 35 case "dlg_ins_dragmath": x = 540; y = 340; break;

As stated earlier, after removal of this code, a browser refresh was completed and the editor reappeared. Hence, I also edited the htmlarea.php file to remove all instances of dragmath there too.

Now that all instances of code have been removed, and the editor is fully functioning, one thing we have not attempted to do is another fresh install of DragMath to see if it functions properly. We will, however, attempt this in a couple of days upon return to the office, and I will post more as to our findings.

Also, once I return to the office, I will zip and upload a copy of the updated dialog.js and htmlarea.php files so that you can see the changes made within.

I hope this helps.

Thanks,

Brian
In reply to Brian Sampson

Re: HTML editor missing caused by DragMath?

by Marc Grober -
Brian,

Thanks. As I recall there were some issues discussed in this regard some months ago as far as editor geometry vs display resolution.... But we did not see the editor completely disappear (Mauno might have a better recollection, but as I recall the issue was the tool bar couldn't fit all the icons....) I will try and track down that discussion, but my guess is off hand that it was the x and y values that were giving you grief, not specifically the case statement.

The extra info will be helpful though, and FYI I packaged the current zip so you don't have to move files around.... Just put in root of moodle and unzip... You could also return the offending line to dialog.js and tweak x and y and see if that doesn't help ( if it does, send me geometry and display resolution - make sure you test on a couple of different monitors or resolutions....)

thanks again
In reply to Brian Sampson

Re: HTML editor missing caused by DragMath?

by Marc Grober -
Well it turns out the issue I was thinking of had to do with the popup size, not htmlarea's size - there were some issues back in 2007 because early versions required patching dialog.js, and cvs updates created problems.

dialog.js is a "dead file" with respect to HEAD as htmlarea is deprecated, but for your 1.9.5+ as I read the cvs you should have had a dialog.js that was last changed in 2006.....
which in the cvs indicates it has not been changed since 2006

// $Id: dialog.js,v 1.1 2006/03/04 15:24:13 julmis Exp $
// Though "Dialog" looks like an object, it isn't really an object. Instead
// it's just namespace for protecting global symbols.

while your dialog.js after installation of 0.7.7.1 from http://tracker.moodle.org/secure/attachment/17154/dragmathformoodle_v0.7.7.1.zip (posted May 5 2009)
would show this at the top:

// $Id: dialog.js,v 1.1.4.2 2008/05/14 16:04:28 net-buoy Exp $
// Though "Dialog" looks like an object, it isn't really an object. Instead
// it's just namespace for protecting global symbols.

I am wondering whether you have two dragmath installations and you edited one that is not in fact being actually sourced??