When editing/creating a node in an administrative overlay, if the node has a file field, the field widget controls triggers this JS error:

Uncaught ReferenceError: simplemenu is not defined

To reproduce, just add a file field to a content type, create a new node (making sure the editing form is in an administrative overlay) and try to upload/delete files. Editing an existing node and trying to remove an uploaded file always triggers the error.

I'm using Google Chrome 15.0.x

Comments

crobinson’s picture

Assigned: Unassigned » crobinson
Priority: Normal » Major

I will attempt to reproduce this issue.

jglynn’s picture

I get this too, in firefox, chrome, ie.

It also screws up the thumbnail creation when you try to upload the file.

manu manu’s picture

Had the same issue (simplemenu is not defined) when trying to change a file display formater (this breaks processing after ajax calls).

AlexisWilke’s picture

Note that if any JS breaks before reaching the SimpleMenu JS (i.e. when put in the footer) then SimpleMenu dies but that is a side effect of the other breakage.

Thank you.
Alexis Wilke

manu manu’s picture

crobinson’s picture

Status: Active » Needs review

I have made a change to the initialization script that checks whether simplemenu is defined before trying to access it. I didn't want to _only_ address the overlay case because I found some other instances that might trigger this. Please check the latest -dev branch and see if this resolve the problem, and if so, please respond here.

If it does not, please supply a line number from Firebug or similar where the error is occurring.

manu manu’s picture

Status: Needs review » Reviewed & tested by the community

Testing the lastest dev, it seems working well..

No issue in node/edit and file display formater.

crobinson’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, moving to closure. We're trying to get to a production release here, starting to look good!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

amanire’s picture

Status: Closed (cannot reproduce) » Active

I'm still experiencing this issue, when removing an image file. The ReferenceError: simplemenu is not defined occurs at this line (28) on the page:

@import url("http://[example.com]/misc/ui/jquery.ui.resizable.css?m9isv4");

I just updated to the current dev version, which appears to be 2012-03-27.

amanire’s picture

Issue summary: View changes

added browser info

crobinson’s picture

Status: Closed (fixed) » Closed (cannot reproduce)

This doesn't look like a module bug, it looks like a configuration error in your site. @import is a CSS include mechanism, it should not be running PHP code on your server. "[example.com]/anything" is not a valid URL for an import - somewhere you have a configuration setting with [example.com] in it that should be replaced with the real hostname for your site.

amanire’s picture

Sorry for any confusion, I replaced the real domain name with [example.com] since the site is still in development.

Update: Not sure if the is relevant but I'm using a Zen 5 subtheme.

amanire’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Here's a bit more context if it helps. Again, I've replaced the real domain name with [example.com] and prepended the line numbers of the page source code.

23 <style type="text/css" media="all">@import url("[example.com]/modules/overlay/overlay-child.css?m9j162");
24 @import url("http://[example.com]/modules/system/system.admin.css?m9j162");
25 @import url("http://[example.com]/misc/ui/jquery.ui.core.css?m9j162");
26 @import url("http://[example.com]/themes/seven/jquery.ui.theme.css?m9j162");
27 @import url("http://[example.com]/misc/ui/jquery.ui.button.css?m9j162");
28 @import url("http://[example.com]/misc/ui/jquery.ui.resizable.css?m9j162");
29 @import url("http://[example.com]/misc/ui/jquery.ui.dialog.css?m9j162");
30 @import url("http://[example.com]/themes/seven/vertical-tabs.css?m9j162");</style>

Firebug reports the error message at line 28.

amanire’s picture

Status: Closed (cannot reproduce) » Active
crobinson’s picture

Status: Active » Needs review

This still isn't a relevant bug for SimpleMenu. The line you've quoted above is part of the core jQuery UI library, and should be posted over on that section. But even if you set that aside a domain name isn't a legitimate start of a URL. It should be http://example.com/whatever.

The problem with Javascript is that any error anywhere can break every script on the page. When SimpleMenu tries to load, its support class needs to exist, and Javascript errors elsewhere can cause that to fail. Verify that you have no errors under Reports->Status Report - things like filesystem permission errors can prevent SimpleMenu (and other modules) from creating their temporary files.

There's no way a CSS include block as you've quoted about can be the source of a Javascript error - there's no Javascript code executing in the block you've quoted. I cannot reproduce this problem and nobody else seems to be experiencing it. Do you have any other information that can be used to reliably reproduce it? Is your site available on a public URL that could be examined remotely? Without something more to go on I may have to Cannot Reproduce this ticket again.

AlexisWilke’s picture

Status: Needs review » Postponed (maintainer needs more info)

Fixing the status.

Status: Active » Postponed (maintainer needs more info)