On a brand-new installation of Drupal 4.7.3, with AcidFree 4.7.0, the mass import and mass edit pages throw a JavaScript error:
"button has no properties" in drupal.js, line 120.
This causes most of the options in these pages, which are collapsed by default, to be un-expandable (they stay hidden). Disabling Javascript shows the correct fields, non-collapsed, but this makes the mass edit page a pain in the !@#$ and having to turn JS off for mass importing kills a lot of useful Drupal functionality elsewhere.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | js_bug.zip | 5.31 KB | eddified |
Comments
Comment #1
vhmauery commentedplease attach the source of the offending page to to this issue. I have seen this before, but I can't seem to reproduce it now.
Comment #2
ataraxis commentedFixed it this way:
file misc/upload.js, function uploadAutoAttach():
// Extract the button ID based on a substring of the input name: edit[foo][bar] -> foo-bar
// OLD: var button = input.name.substr(5, input.name.length - 6).replace('][', '-');
var button = input.name.replace(/\]\[/g, '-'); // FIX
var button = button.replace(/\[/, '-'); // FIX
var button = button.replace(/\]/, ''); // FIX
the problem seems to be caused by unsuccessfully trying to generate element id's from names like "edit[node_items][attachments][wrapper][attach]" in the html. to be more exact, it seems that replace('][', '-') only replaces the first occurance, it skips the starting 'edit' word and fails to replace the start end end bracket (respectively '[' and ']' ).
Installed dupal, acidfree and all the required modules today so everything it's brand new.
Comment #3
vhmauery commentedataraxis,
Please post a patch to fix this issue. If you don't know how to create a patch, visit http://drupal.org/diffandpatch
Thanks for posting how to fix it, but a patch is a much less error-prone method to share fixes and will get more attention from the powers that be.
Since this is not really an acidfree issue, I am changing the project to Drupal javascript
Comment #4
eddified commentedstill a problem with drupal 4.7.4....
I reproduced this on drupal 4.7.4, acidfree 4.7..... (should be really simple to reproduce...)
I don't think you need this info (since it's just a JS issue), but i am running php 5.2.0, mysql 5.0, apache 2.2.3
Comment #5
vhmauery commentedthis appears to be a theme-dependent issue. It seems to work fine for me on the default drupal theme (which is not very pleasing to the eye, so you probably aren't using that...)
Try switching themes to see if it goes away with another theme. What theme are you using? Please don't tell me friendselectric :) Yikes. That theme has been nothing but trouble for acidfree. This may turn out to be a theme issues... If that is the case, I don't think I have to fix it.
Comment #6
eddified commentedI actually reproduced this using the default theme (bluemarine).
I have attached the original misc/upload.js file that I got with my drupal install (with the exception that I have added the fix given by ataraxis, but THE FIX IS COMMENTED OUT, so code-wise (not counting comments), it should be exactly what comes with the 4.7.4 install of drupal).
I have also attached the html source that is generated on the mass import page.
btw, i'm running windows xp as well as php 5.2.0, mysql 5.0, apache 2.2.3
what other source would you like me to provide?
Btw, my friend installed drupal on her machine and had this same problem but it went away once she got rid of the 'mass import' MODULE which she thought she needed for acidfree to work. however, she had acidfree 4.7.0, but i have acidfree 4.7.x.....
Comment #7
eddified commentedsorry, i forgot to mention this (but you probably already know this...)
the mass import page works if the browser cant find all of the necessary js files.... ie, if you unzip my attachment on my last post, and put it into just any old directory, then the mass import will work because all elements will be shown by default. so in order to duplicate this bug, you will have to have it point to all the necessary js files... :X
Comment #8
eddified commentedThis is probably the wrong place to do this, but I just want to thank vhmauery for the work he does on Acidfree.... I really like acidfree (in fact, it's pretty much the only thing my family uses on our drupal website!) and i'd just like to say, "GREAT WORK!"
thanks again,
eddified
Comment #9
vhmauery commentedOne way to avoid this is to go to admin/settings/content-types/acidfree and tell it not to allow attachments to acidfree nodes.
eddified, I am glad you like acidfree. <shameless-plug>If you like it, please donate http://vernon.mauery.com/content/projects/software/acidfree/donate to help support future work (the fund goes to buy dinner and flowers for my wife so she will let me work on Acidfree) :-)</shameless-plug>
Comment #10
eddified commentedthanks, vhmauery! That solved the problem. I tried the fix that ataraxis proposed, and it worked, but after looking at it, I was afraid it would break other drupal functionality elsewhere. So this workaround you proposed is nice, and I will revert back to the original upload.js that shipped with drupal. So, what is the verdict? Is the bug really an acidfree bug or a drupal bug??
Comment #11
ricabrantes commentedany news about this?
Comment #12
maartenvg commentedMarking fixed. Upload.js not even exists anymore.
Comment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.