I wasn't sure whether to post this under jquery_ui or here, and the fact that such a fundamental bug hasn't been reported before led me to file this as a 'support request' rather than a 'bug report'. NodeReference Explorer works fine with Drupal's Javascript Optimization turned off, but when I turn it on it fails.
This is true of every version I tried, which included beta's 5 and 6, as well as the latest dev.
I also tried it with both Jquery UI 1.6 and jquery UI 1.x-dev and experienced the same results.
I've tried it with and without JQuery Update 1.1 installed.
I'm using Drupal 6.13
The real question i want to ask is: does Nodereference Explorer work with JavaScript Optimization On for anyone?
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | Nodereference_explorer_3.patch | 11.63 KB | omerida |
| #9 | Nodereference_explorer_2.patch | 14.81 KB | wojtha |
| #9 | nodereference_explorer.zip | 13.66 KB | wojtha |
| #7 | nodereference_explorer.patch | 11.36 KB | wojtha |
Comments
Comment #1
vood002 commentedDidn't mean to sound like a dick by bolding the question... I just wanted someone scanning to get to the important part. Does NRX work for anyone with Javascript Optimization turned on?
Comment #2
Anonymous (not verified) commentedSame problem, clicking "Browse" keeps loading, but no modal pops up, nothing happens. I have regular jquery from drupal, plus standard versions of the rest.
Comment #3
abaddon commentedditto, i get this javascript error: Drupal.nodereference_explorer.actions is undefined - and context " .click(Drupal.nodereference_explorer...ss('nodereference-explorer-processed');\n"
i think it should be filled under bug reports, correct me if im wrong, if no one deals with it ill probably look to fix it in the next 2 weeks
$ grep -rn "click(Drupal.nodereference_explorer" .
./nodereference_explorer/js/explorer.actions.js:20: .click(Drupal.nodereference_explorer.actions.browse).addClass('nodereference-explorer-processed');
./nodereference_explorer/js/explorer.actions.js:23: .click(Drupal.nodereference_explorer.actions.remove).addClass('nodereference-explorer-processed');
the NRX object is undefined with only js aggregation turned on (and not caching) , why could it happen? it seems its initialized just a couple of lines above..
Comment #4
Anonymous (not verified) commentedI tried the built in modal, and the modal form api for the popups, both break with javascript compression ON.
Comment #5
stacysimpson commentedDitto. With Javascript optimization turned on and using beta6, the model dialogue opens and I can select a value. However, the selected value in modal dialog doesn't take effect. AJAX clock animation just spins forever.
Comment #6
bibo commentedSubscribing.
This module seems incredibly promising (just what I needed: Image noderefencing with Views integration). So far it seemed to be the best image-related module for my needs. Working Drupal js compression is also crucial (to my projects at least).
Comment #7
wojtha commentedHello,
there is a sligthly bigger patch for that.
Fixes:
1) Javascript optimalization
2) CSS optimalization
3) minor Javascript (LINT) fixes
Note: You need rebuild a theme cache after apllying this patch to make it working.
Javascript & CSS optimalization
========================
JS and CSS filenames cannot be parsed from the HTML document, when JS or CSS optimalization is enabled, because multiple files are aggregated into one file with a random name. So I created page preprocess hook and I capture all JS and CSS filenames which are registered via drupal_add_js() and drupal_add_css() functions. Than I store them in the Drupal.settings object (Drupal.settings.jsInit, Drupal.settings.cssInit) to make them accessible in javascript.
Later when "Browse" button is clicked and additional CSS and JS files are going to be loaded with Ajax, all files are checked if they exists in Drupal.settings "init" arrays - if filename exists in the array it is not going to be loaded.
Minor Javascript fixes
================
My IDE and also JSLint (http://www.jslint.com) reports "Missing semicolon" warnings on each closure, so I added them.
The second minor improvement is "defensive" initialization of namespaces.
Comment #8
gnindl commentedOn fields with multiple values I receive
Drupal.settings.cssInit is undefined /sites/default/modules/nodereference_explorer/js/explorer.js?X Line 74
Seesm that the css files are not added correctly.
Comment #9
wojtha commentedHi gnidl,
I have also multiple field with multiple values, but I can't reproduce the error. I remember I got this error during development of the patch, but I fixed it. For me everything working smoothly (FF 3.5, IE 8). Only error which I get sometimes after closing modal window is "handler is undefined" JS error, but this error I get also with unmodified Beta6, so it isn't caused by "my" code.
Line 74 in explorer.js is a nonsens - in my patched file I have a comment on this line.
I'm sending another patch. And also all changed files in archive to make sure that bad patch doesn't screw it :-)
Comment #10
gnindl commentedSorry, I don't get it, maybe you have a different setup.
Mine is:
Drupal 6.12
jquery_ui 1.3
jQuery UI 1.6 (with jQuery 1.2.6)
Firefox 3.5.5
I don't use jquery_update.
@wojtha: What do you use?
Comment #11
wojtha commented@gnidl:
Drupal 6.14, built-in jQuery 1.2.6, jQuery UI 1.3 with 1.6 UI lib
Windows Vista 32bit
Firefox 3.5.5
Internet Explorer 8
Comment #12
vood002 commentedI tested earlier today, and was still receiving an error almost exactly as described in #5. I applied the patch_2 from #9 and it is now working with javascript optimization turned on.
Great work guys~I'll continue to test and make sure everything is working
Comment #13
vood002 commentedI've tested again today with beta7, and NRX continues to not function with optimization turned on. Upon applying this patch, NRX functioned correctly. I've changed the status to 'reviewed and tested by the community'
Comment #14
andylin12 commentedI met the "cssInit undefined" issue when applying the patch with Drupal 6.13.
But the issue get fixed after I empty the cache in the performance setting and everything went fine.
Hope that helps.
Comment #15
omerida commentedpatch in #9 didn't work for me. I don't think you can simply manipulate the array you get from drupal_add_js() and drupal_add_css() and expect your changes to persist through later preprocess functions. Those two functions keep an internal array with js and css data, so you have to use them.
I re-rolled a patch that works for me and also removed a .buildpath and .project file inadvertently included in the same patch. Nodereference explorer is working for me now.
My setup - Drupal 6.13, NRX 6.x-1.x-dev
I also have Lightbox2 installed, jquery ui 1.6, and jquery update to 1.2.6
Comment #16
gnindl commentedThe patch of #15 has been reviewed, used as a working base and further developed. Check out the current dev snapshot for further testing.
Comment #17
jasonawantlatest dev snap shot is working with css and js optimization enabled.
Comment #18
gnindl commentedPatch included in the release candidate