Just did the 6.16 core update and various module updates including Nodereference Explorer to latest DEV version and then the "browse" button wasn't working. The little ajax loading animation just kept spinning and the error caught by firefox was:

Error: Drupal.settings.cssInit is undefined
Source File: http://iccare.ca/sites/all/modules/nodereference_explorer/js/explorer.js?d
Line: 64

I installed an older version of Nodereference Explorer (nodereference_explorer 6.x-1.1-beta7) and its working again. Thats all the info I have unfortunately.

Love the module though!

cheers,
Lee

Comments

gnindl’s picture

Probably your issue is theme dependent. Which theme are you using, maybe a custom one? How and when do you include your JS scripts and CSS stylesheets in your node.tpl.php? Sharing your theme would make debugging possible.

gnindl’s picture

Status: Active » Fixed

Just clearing the server side cache after updating should fix the problem

vuzzbox’s picture

I'm getting the same error. I am using the latest version of the RootCandy theme for the admin side. I have tried clearing the server side cache (assuming that by this you mean clear the cache in the admin/config/performance ) but still get the same error.

For reference here's all the javascript that's loaded by the theme:

    <script type="text/javascript" src="/misc/jquery.js?y"></script>
<script type="text/javascript" src="/misc/drupal.js?y"></script>
<script type="text/javascript" src="/misc/tabledrag.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/jquerymenu/jquerymenu.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/nodereference_explorer/plugins/cck/nodereference/nodereference_explorer_plugin_cck_nodereference.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/nodereference_explorer/plugins/cck/link/nodereference_explorer_plugin_cck_link.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/views_slideshow/js/jquery.cycle.all.min.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js?y"></script>

<script type="text/javascript" src="/sites/all/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/views_slideshow.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/views/js/base.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/views/js/ajax_view.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/pathauto/pathauto.js?y"></script>
<script type="text/javascript" src="/misc/jquery.form.js?y"></script>
<script type="text/javascript" src="/misc/ahah.js?y"></script>
<script type="text/javascript" src="/misc/progress.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/filefield/filefield.js?y"></script>
<script type="text/javascript" src="/misc/autocomplete.js?y"></script>

<script type="text/javascript" src="/misc/collapse.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/nodereference_explorer/js/explorer.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/nodereference_explorer/js/explorer.actions.js?y"></script>
<script type="text/javascript" src="/misc/tableheader.js?y"></script>
<script type="text/javascript" src="/misc/teaser.js?y"></script>
<script type="text/javascript" src="/misc/textarea.js?y"></script>
<script type="text/javascript" src="/sites/all/modules/tinytinymce/tinymce/jscripts/tiny_mce/tiny_mce.js?y"></script>
<script type="text/javascript" src="/sites/all/themes/rootcandy/rootcandy.js?y"></script>
<script type="text/javascript" src="/sites/all/themes/rootcandy/slider/slide.js?y"></script>

<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "views": { "ajax_path": [ "/views/ajax", "/views/ajax", "/views/ajax" ], "ajaxViews": [ { "view_name": "noderelationships_backref", "view_display_id": "default", "view_args": "62/partner_type/field_people", "view_path": "node/62/edit", "view_base_path": "noderelationships/noderelationships-backref", "view_dom_id": 1, "pager_element": 0 }, { "view_name": "noderelationships_backref", "view_display_id": "default", "view_args": "62/projects_details/field_people_page", "view_path": "node/62/edit", "view_base_path": "noderelationships/noderelationships-backref", "view_dom_id": 2, "pager_element": 1 }, { "view_name": "noderelationships_backref", "view_display_id": "default", "view_args": "62/publications/field_people_page", "view_path": "node/62/edit", "view_base_path": "noderelationships/noderelationships-backref", "view_dom_id": 3, "pager_element": 2 } ] }, "ahah": { "edit-attach": { "url": "/upload/js", "event": "mousedown", "keypress": true, "wrapper": "attach-wrapper", "selector": "#edit-attach", "effect": "none", "method": "replace", "progress": { "type": "bar", "message": "Please wait..." }, "button": { "attach": "Attach" } }, "edit-field-plo-photourl-0-filefield-upload": { "url": "/filefield/ahah/people_details/field_plo_photourl/0", "event": "mousedown", "keypress": true, "wrapper": "edit-field-plo-photourl-0-ahah-wrapper", "selector": "#edit-field-plo-photourl-0-filefield-upload", "effect": "fade", "method": "replace", "progress": { "type": "bar", "path": "filefield/progress/0faf63ed097f09ae4bb7087afc8f0510", "url": "/filefield/progress/0faf63ed097f09ae4bb7087afc8f0510" }, "button": { "op": "Upload" } }, "edit-field-plo-photourl-0-filefield-remove": { "url": "/filefield/ahah/people_details/field_plo_photourl/0", "event": "mousedown", "keypress": true, "wrapper": "edit-field-plo-photourl-0-ahah-wrapper", "selector": "#edit-field-plo-photourl-0-filefield-remove", "effect": "fade", "method": "replace", "progress": { "type": "throbber" }, "button": { "field_plo_photourl_0_filefield_remove": "Remove" } }, "edit-field-university-page-field-university-page-add-more": { "url": "/content/js_add_more/people-details/field_university_page", "event": "mousedown", "keypress": true, "wrapper": "field-university-page-items", "selector": "#edit-field-university-page-field-university-page-add-more", "effect": "fade", "method": "replace", "progress": { "type": "throbber" }, "button": { "field_university_page_add_more": "Add another item" } } }, "nodereference_explorer": { "field_university_page": { "dialog": "/nodereference_explorer/dialog/people_details/field_university_page", "modalframe": "/nodereference_explorer/modalframe/people_details/field_university_page", "dialog_api": "nodereference_explorer", "field_type": "nodereference", "preview": "/nodereference_explorer/preview/people_details/field_university_page", "widgets": { "edit-field-university-page-0-nid-nid": [ "edit-field-university-page-0-button-browse", "edit-field-university-page-0-button-remove" ], "edit-field-university-page-1-nid-nid": [ "edit-field-university-page-1-button-browse", "edit-field-university-page-1-button-remove" ] } } }, "tableDrag": { "field_university_page_values": { "field_university_page-delta-order": [ { "target": "field_university_page-delta-order", "source": "field_university_page-delta-order", "relationship": "sibling", "action": "order", "hidden": true, "limit": 0 } ] }, "upload-attachments": { "upload-weight": [ { "target": "upload-weight", "source": "upload-weight", "relationship": "sibling", "action": "order", "hidden": true, "limit": 0 } ] } }, "teaserCheckbox": { "edit-teaser-js": "edit-teaser-include" }, "teaser": { "edit-teaser-js": "edit-body" }, "jsInit": { "misc/jquery.js": true, "misc/drupal.js": true, "misc/tabledrag.js": true, "sites/all/modules/views_slideshow/js/jquery.cycle.all.min.js": true, "sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js": true, "sites/all/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/views_slideshow.js": true, "sites/all/modules/views/js/base.js": true, "sites/all/modules/views/js/ajax_view.js": true, "sites/all/modules/pathauto/pathauto.js": true, "misc/jquery.form.js": true, "misc/ahah.js": true, "misc/progress.js": true, "sites/all/modules/filefield/filefield.js": true, "misc/autocomplete.js": true, "misc/collapse.js": true, "sites/all/modules/nodereference_explorer/js/explorer.js": true, "sites/all/modules/nodereference_explorer/js/explorer.actions.js": true, "misc/tableheader.js": true, "misc/teaser.js": true, "misc/textarea.js": true, "sites/all/modules/tinytinymce/tinymce/jscripts/tiny_mce/tiny_mce.js": true }, "cssInit": { "style.css": true, "admin.css": true, "defaults.css": true, "system.css": true, "system-menus.css": true, "user.css": true, "content-module.css": true, "date.css": true, "datepicker.css": true, "timeentry.css": true, "filefield.css": true, "jquerymenu.css": true, "views_slideshow.css": true, "fieldgroup.css": true, "views.css": true, "noderelationships.backref_views.css": true, "imagefield.css": true, "link.css": true, "explorer.form.css": true, "explorer.all.css": true } });
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
tinyMCE.init({
   mode : "exact",
   file_browser_callback: "imceImageBrowser",
   init_instance_callback : "resizeEditorBox",
   theme : "advanced",
   convert_urls : false,
   plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
   theme_advanced_buttons1 : "bold,italic,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,|,formatselect, styleselect, ",
   theme_advanced_buttons2 : "link,unlink,anchor,image,|,cut,copy,paste,pastetext,pasteword,iespell,|,nonbreaking,charmap,sub,sup,media,hr,advhr,|,search,replace",
   theme_advanced_buttons3 : "tablecontrols,|,visualaid,cleanup,removeformat,code,fullscreen",
   theme_advanced_toolbar_location : "top",
   theme_advanced_toolbar_align : "left",
   theme_advanced_statusbar_location : "bottom",
   theme_advanced_resizing : true,
   extended_valid_elements : "iframe[src|width|height|name|align],a[name|href|target|title|onclick],img[style|class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
   template_external_list_url : "/sites/all/themes/utrc/js/example_template_list.js",
   content_css: "/sites/all/themes/utrc/css/tinyMCE.css"
});

function resizeEditorBox (editor) {
   document.getElementById(editor.id + "_tbl").style.width = "100%";
}
   
function toggletinyMCE(id) {
   if (!tinyMCE.getInstanceById(id)) {
      tinyMCE.execCommand('mceAddControl', false, id);
   } else {
      tinyMCE.execCommand('mceRemoveControl', false, id);
   }
}

Drupal.behaviors.teaser = function() {};
      
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--

   function imceImageBrowser(fid, url, type, win) {win.open(Drupal.settings.basePath +'?q=imce&app=Editor|url@'+ fid, '', 'width=760,height=560,resizable=1');}
//--><!]]>
</script>
vuzzbox’s picture

Version: 6.x-1.x-dev » 6.x-1.1-rc1
Status: Fixed » Needs review

I've changed the status and version on this. I've been working all day to resolve the same problem:

Drupal.settings.cssInit is undefined
[Break on this error] if (!Drupal.settings.cssInit[bas...(link).attr('href') + ']').length) {

I've searched the source code for my entire site looking for an instance where this method is defined, but the only place where I come up with a reference to cssInit is in the nodereference explorer module and only on the line where its called. It doesn't seem to be defined in anywhere else in the site.

As the with the original poster on this message, if I go back to nodereference_explorer 6.x-1.1-beta7, it works (although i did have to rename a file called nodereference_explorer_plugin_cck_nodereference.inc0000644 to nodereference_explorer_plugin_cck_nodereference.inc in order for it to work - that might just be a source control thing I don't understand, though)

- Ed

gnindl’s picture

The source code from #3 seems fine, as the array Drupal.settings.nodereference_explorer.cssInit is set with the initial page load, i. e.:

"cssInit": { "style.css": true, "admin.css": true, "defaults.css": true, "system.css": true, "system-menus.css": true, "user.css": true, "content-module.css": true, "date.css": true, "datepicker.css": true, "timeentry.css": true, "filefield.css": true, "jquerymenu.css": true, "views_slideshow.css": true, "fieldgroup.css": true, "views.css": true, "noderelationships.backref_views.css": true, "imagefield.css": true, "link.css": true, "explorer.form.css": true, "explorer.all.css": true }

So somehow, this JavaScript is not correctly initialized/read. I could reproduce this error when I upgraded from 1.1-beta7 to 1.1-rc1, as the previous version doesn't provide this array. As I said after clearing the server-side cache, i. e. use admin menu http://localhost/drupal/?q=admin_menu/flush-cache, it works again.

Otherwise it might related

* to your client, i. e. browser (which one are you using?). Try clearing the client cache.
* to your theme or configuration. This module needs certain JS settings to include CSS files.

Hint: When you comment the method nodereference_explorer_preprocess_page in nodereference_explorer.module you get the same effect (error). Maybee this method is not called properly?

presleyd’s picture

I get this error when using the module jQuery Update (http://drupal.org/project/jquery_update) which isn't terribly surprising but it would be nice if the two could work together.

inforeto’s picture

Version: 6.x-1.1-rc1 » 6.x-1.x-dev
Status: Needs review » Active

Getting this error on both 6.x-1.1-rc3 and 6.x-1.x-dev of may 5th.
Clearing both drupal cache and the browser's cache didn't work.
So far tested on firefox 3.5 and chrome.
6.x-1.1-beta7 did not show the error but isn't a solution since that version has other issues.

mattiasj’s picture

I experience the same behaviour using 6.x-1.1-rc3 and 6.x-1.x-dev of may 5th using Zen as my base theme. My install is pretty clean so there shouldnt be much conflicts. I'm currently trying this out with Modal frame, jQuery UI and jQuery update - all latest versions.

mani.atico’s picture

As noted by #6 jquery_update uses a similar approach to nodereference explore in order to override the 'scripts' variable, leaving the settings declared by la later out. I managed to correct this by adding two extra lines to nodereference_explorer_preprocess_page (a clener code is possible but i'm in a rush):

drupal_add_js(array('cssInit' => $css), 'setting');
drupal_add_js(array('jsInit' => $js), 'setting');

But now I'm getting another js error (I'm using the link reference):

$(widget).val(value).blur is not a function

Checked the 'value' variable and it's undefined. I don't know if the error is related or if it should be in a different issue.

gnindl’s picture

Version: 6.x-1.x-dev » 6.x-1.1-rc4
Assigned: Unassigned » gnindl
Status: Active » Needs review

Committed #9 to the repository and it is included in 1.1-rc4. Please test it thoroughly with jquery_update as there are conflicts with the $variables['script'].

gnindl’s picture

Status: Needs review » Fixed

Patch from #8 has been thoroughly tested and will therefore be included in the next release.

Status: Fixed » Closed (fixed)

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

xpersonas’s picture

Version: 6.x-1.1-rc4 » 6.x-1.1-rc5

I'm getting this error with RC5. I'm not sure I understand if this is possible to patch or not. This module is so close to being what i need perfectly. I'm so disappointed that I'm getting this error now.

yogeshchaugule8’s picture

Was having the same problem mention by #9

$(widget).val(value).blur is not a function

To solve this problem I have added condition before adding blur event in nodereference_explorer_plugin_content_nodereference.js.

nodereference_explorer_plugin_content_nodereference_setValue = function(widget, value) {
  if (value) {
    $(widget).val(value).blur(); //trigger change event for depending actions
  }
}