Closed (fixed)
Project:
Web File Manager
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2010 at 16:02 UTC
Updated:
1 Sep 2010 at 13:40 UTC
In modules/webfm_popup/webfm_popup.js:
function webfm_popupGetMenusAjax() references a variable called "Webfm" which does not seem to be defined in all cases (I get an error message). I was not able to track down where this variable is defined due I am short of time currently so I modified the function code to check if the variable is defined (see patch below).
Please check why the variable is not set when required - applying the patch will at least be a work around to get rid of the FS error message. Please consider applying the patch to HEAD if the issue cannot be fixed until the next release.
| Comment | File | Size | Author |
|---|---|---|---|
| module-webfm-004-JS_Webfm_undefined-6.x-2.x-dev.patch | 635 bytes | fajo |
Comments
Comment #1
cgmonroe commented(Twilight zone music playing...) I just had the same issue this week.... really! And had it on my todo list to supply a patch.... which looks close to yours... I'd suggest a minor change. Instead of checking for WebFM's existence in the webfm_popupGetMenusAjax() function, wrap the call to the function. E.g. under the Drupal.jsEnabled check.
The reason for this is that future versions of webfm_popup (like one I'm working on :) ) may call other functions that require WebFM. This lets all the functions only needed on the browser page to be controlled in one spot.
FYI - The reason it works sometimes and not others is that if you have WebFM attachments enabled on the context type, the Webfm javascript get included. However, if attachments aren't enabled, the webfm core does not get loaded. You patch is actually the correct way to do this because the webmf_popupGetMenusAjax() function is only needed in the browser page. The other Javascript is there to support the rich text editor.
When the "browser" icon is clicked in the Rich Text Editor, the page that gets opened will have the WebFM core javascript loaded and the webfm specific functions will be called.
Comment #2
nhck commentedfajo thank you again for reporting this and helping to make webfm better.
I checked it out and improved it as cgmonroe suggested (thanks!)
Ah..it would be some much nicer if we could use "Send to rich text editor" from the webfm_attachment file browser as well.