I have a node type club that has a nodereference field members to select nodes of type player. I use Multiselect widget to select the player nodes that need to be referenced. The widget works great when there are relatively small number of potential nodes that could be referenced. However, when the number of potential references gets bigger I get a javascript warning message from my browser:
"Warning: unresponsive script / A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete." If I choose to wait it will finally work as expected but it's really slow...
This warning is shown when the browser is loading the edit page of the node (of type club). I currently have about 1000 nodes on my site, of which about 725 are of type 'player'. This number of potential references is enough to trigger the problem.
While testing I changed the nodereference options of this node type so that it allowed all other node types to be referenced except players (leaving the number of potential references to about 275). This did not trigger the javascript warning.
The same warning occurs when I go to change the configuration of this nodereference field in content type settings
admin/content/types/club/fields/field_members
Tested on WinXP + Firefox 2, WinXP + IE7, Ubuntu 6.06 + Firefox 1.5 with the same results.
Any ideas about this? Is the problem in the multiselect module, in the player node type, in the database or what?
-Markus
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | multiselect-slash.patch | 1.15 KB | masipila |
Comments
Comment #1
bengtan commentedHi,
Just wanted to add my two bits worth. I'm running into the same problem as well.
Multiselect causes javascript to lock up with a nodereference field if there are about 1000 potentially selectable nodes. Either a lock up, or it just takes too long to be practical.
Experienced this on Firefox 1.5.0.13pre, and Epiphany 2.14.1.1, both on Ubuntu 6.06.
If I comment out line 110 in multiselect.module, like so:
// drupal_add_js($path . '/multiselect.js');
the error/warning box doesn't trigger, but neither does the multiselect widget work properly (obviously).
I looked in multiselect.js, but didn't see anything obvious.
One thing I can suggest is that maybe javascript just falls over in general when manipulating that many items, and it's not necessarily the logic in multiselect.js.
Comment #2
ravindrapatil commentedI have written a code to load the list of existing email id list in asp.net page using Ajax autocomplete control. It works fine on local machine but it dosent work on server.
it shows me error :
"Warning: unresponsive script / A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete."
Please tell me what is the problem?
Comment #3
bengtan commentedravindrapatil, please file a new bug under the Ajax Checklist module, not under Multi select.
Comment #4
Johannes De Boeck commentedhas anyone found a solution to this script problem?
Comment #5
michael_kirk commentedThe problem is something like this: This widget keeps two lists, one of selected and one of unselected items. On page load, the items are all in the selected list, and the ones that aren't actually selected are moved (one at a time with javascript) to the unselected list. This initialization is what takes so much time. Probably it should be that the lists are properly populated server-side. I'll start working on this and post a patch when I've got something.
Testers much appreciated ;)
Comment #6
masipila commentedI'll be happy to help with testing. I'll be watching this thread but if you want to contact me directly drop an email to markus.sipila % curling.fi.
-Markus
Comment #7
Miszel commentedI have run into the same problem. Please let me know if there is anything that can be tested.
Comment #8
masipila commentedHi,
I just came back from a holiday trip and noticed that 2.0-beta has been released. Great news!
I'll test 2.0-beta within about a week and post my comments here.
-Markus
Comment #9
michael_kirk commentedI expect a significant increase in performance with the beta. Please let me know how it works for you.
Comment #10
masipila commentedHi,
I was finally able to dig into this and do some testing I had promised to do. Sorry it took so long.
I noticed a problem with + and - buttons that are supposed to be visible between the selected and unselected lists. I have i18n modules installed on my site and thus the URL addresses are something like http://www.example/com/en/path/to/node or http://www.example.com/fi/path/to/node depending on the selected language, of course.
I guess the language identifier that i18n modules provide interfere with this module so that the + and - buttons are not showing correctly. As I examined this a little I found out that the img src attributes of these images don't have leading slashes. If I add this slash to the src attributes the buttons show up and the module seems to work as expected. Please review the patch that adds these leading slashes.
Another issue that I noticed is that this module puts the newly selected items to the end of the list. In my case Clubs can have hundreds of Members so it is very hard to find a Member you are looking for because the lists are not sorted alphabetically.
The conceptual problem here is that this module does not know the order of the items if the potential nodes to be referenced are defined with a special view that puts the items in a non-alphabetical order. However, because this module doesn't provide functionality to re-order items within a list it can be argued that the order of selected items must be insignificant for the users of this module. Thus, it should not be a problem to the users of this module if the items were sorted alphabetically (I guess :).
I'm not too experienced with JS myself but I guess it would be relatively easy to put the item to a right place in the lists when it is added to the list. I don't think that this extra calculation would cause similar unresponsive script problems that we saw in this original issue. However for my use, it would be perfectly OK to sort the selected list on the server side when the form is submitted, I don't need the fancy JS-based feature where the items go directly to their own place in the list.
-Markus
Comment #11
masipila commentedOh, I forgot to mention that I tested on FF 2.0.0.16 and IE7, both on WinXP.
-Markus
Comment #12
michael_kirk commentedThanks very much masipila. I'll get your patch uploaded soon.
Regarding your comment on sorting, are you interested in sorting the list of selected nodes?
Specifically, I want the order on the right to be induced by the person using the form. So if you want A,B,C or C,B,A you can order them that way. Unfortunately, there isn't yet an easy tool to do this, apart from adding them in the order you want them to be ordered. I do not plan to have the list of selected nodes be ordered in any way besides the order they are selected on the form, unless I can be convinced that this will be useful to more people than it is detrimental. I do have plans to include a simple "move up" and "move down" button to make it easier to reorganize the selected list.
If there were a way to sort the selected entries, how do you think it should work? I would very much like to avoid putting functionality into javascript unless it also exists server side. It's my intention to make this module completely functional (though probably quite cumbersome) with javascript disabled. If you come up with something would you open a new feature request ticket?
Thanks for the input masipila, and the patch.
Comment #13
michael_kirk commentedIm going to resolve this, as I'm convinced that the issue of "unreponsive script" messages occured based on the sorting being done client side with javascript. Sicne that's no longer the case. I'll be resolving this. (your other issue regarding sorting and internationalization exist elsewhere masiplia)
Comment #14
michael_kirk commentedComment #15
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.