Posted by suidu on November 7, 2009 at 3:37pm
Jump to:
| Project: | Hierarchical Select |
| Version: | 6.x-3.x-dev |
| Component: | Code - Taxonomy Views |
| Category: | task |
| Priority: | normal |
| Assigned: | Wim Leers |
| Status: | closed (fixed) |
Issue Summary
Hi Wim,
first: thanks for the great HS module!
I just recognized a problem with Hierarchial Select in a View with AJAX enabled using the pager.
On the first page it works. On all further pages there is the message "You don't have Javascript enabled" - see attached screenshot.
I installed the current version of 6.x-3.x-dev and the current Views module. I tested the issue in a clean Drupal installation in Safari 4 and Firefox 3.5
Do you know where the problems comes from?
Best
Suidu
| Attachment | Size |
|---|---|
| drupal-test-installation-hierarchical-select.png | 44.99 KB |
Comments
#1
Odd. Seems that Views is not attaching Drupal behaviors? Moving to the Views issue queue to get feedback.
#2
If hierarchical select uses the 'settings' javascript, then it is difficult to transmit these settings back to the page during ajax operations. (Note that the ajax system in Drupal 7 has more or less aleviated this, but in D6 this is still a problem).
Views *does* call behaviors in its ajax operations.
#3
I see. HS indeed uses Drupal.settings. Thanks Merlin!
#4
This will cost a fair amount of time and frustrated debugging sessions. Drupal's AHAH/AJAX support is too immature to accommodate for this properly.
I'll welcome your patches but I won't figure out a work-around in my free time.
#5
#6
Wim - this sounds related to the issue I posted here: http://drupal.org/node/734178#comment-3212202
I am willing to sponsor a fix if it can solve my issue in the link. Please let me know. Thanks.
#7
+1
#8
Reproduced.
zeezhao is sponsoring the fix.
#9
Eventually, I found an acceptable work-around! Fixed.
http://drupal.org/cvs?commit=412572
#10
Here is what I get after installing the 3.x-dev:
I use 2 taxonomy terms (each has it's library) for search using Views.
After paging, I see that the bug is fixed for the second (last) term.
But for the first one, the message "You don't have Javascript enabled ..." is still there.
switching the order of these two terms - still the second (last) term is OK, the first one not.
The above description happens after a refresh was made to a page.
I use level labels.
I selected "all" in both terms, without clicking the "search" button. The message did not appear after paging
tried to do the same while both level lables disabled - the message appeared after paging.
Hope this info help.
To add more info:
I use module "views display tabs".
If I enable the Ajax option in the view then I see the above JS message when paging.
If I disable it - no problems with the pager
#11
This patch has the consequence of adding Drupal.HierarchicalSelect.ajaxViewPagerSettingsUpdate as a callback to ALL Ajax Views requests, even for Views which don't use a hierarchical select widget. In these cases, the HS widget's scripts haven't been loaded (because they're not needed), so all these views break as a result because (Safari)
TypeError: Result of expression 'Drupal.HierarchicalSelect' [undefined] is not an object.I've opened an issue #911486: ajaxViewPagerSettingsUpdate callback added to all ajax Views callbacks even when HS widget isn't used..#12
#11 I had a similar issue with 6.x-3.5, what I did was just add a try catch block in function Drupal.HierarchicalSelect.ajaxViewPagerSettingsUpdate changing this:
Drupal.HierarchicalSelect.ajaxViewPagerSettingsUpdate = function(target, response) {$.extend(Drupal.settings.HierarchicalSelect.settings, response.hs_drupal_js_settings);
Drupal.attachBehaviors($(target));
};
to this:
Drupal.HierarchicalSelect.ajaxViewPagerSettingsUpdate = function(target, response) {try {
$.extend(Drupal.settings.HierarchicalSelect.settings, response.hs_drupal_js_settings);
Drupal.attachBehaviors($(target));
}
catch(err) {
//nothing
}
};
Well, maybe this is just a fast workaround, but by doing this I avoid JS from crashing, and as I'm not using hierarchical select widget on my exposed field, it doesn't matter that: "Drupal.settings.HierarchicalSelect is undefined" [Error thrown in console].
Regards
#13
I seem to have a related issue:
My pagers don't work anymore for any view. It shows up correctly but is totally inactive. The Java console reports this error:
Uncaught TypeError: Cannot read property 'ajaxViewPagerSettingsUpdate' of undefinedIf I disable Ajax, it works.
If I disable Hierarchical Select, it works (though HS is not involved at all)
#14
Was getting
Drupal.HierarchicalSelect is undefinedwith 3.5; latest dev fixes the issue. #911486: ajaxViewPagerSettingsUpdate callback added to all ajax Views callbacks even when HS widget isn't used.#15
mikeytown2's comment implies that I should issue a new release. So that's what I'm doing right away :)
#16
Done: HS 3.6 — http://drupal.org/node/930560.
#17
Automatically closed -- issue fixed for 2 weeks with no activity.