Closed (fixed)
Project:
Views Bulk Operations (VBO)
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Jan 2009 at 05:13 UTC
Updated:
5 Mar 2009 at 08:40 UTC
When views form is loaded dynamically using AHAH/AJAX the Views Bulk Operations behavior is broken.
To fix this, vbo would have to implement its startup code using Drupal.behaviors rather than if (Drupal.jsEnabled) { jQuery(document).ready(function() { .... See misc/textarea.js for an example. Then, it may not need to invoke the startup code from ajaxViewResponse() as I believe this would be done already by Drupal.Views.Ajax.ajaxViewResponse() in views/js/ajax_views.js. If not, then you may probably invoke that from your ajaxViewResponse() implementation.
Comments
Comment #1
infojunkieI was expecting this. But can you explain what is currently broken with AHAH? I've tried Views with Ajax on and things seemed to be working properly.
Comment #2
markus_petrux commentedI came here due to a problem in editablefields module: #359435: Editablefields will not work if Views Bulk Operations is also active
Note that any module can implement AHAH/AJAX stuff in views that causes to rebuild part of the DOM in the document, and that part may affect the whole view, hence that AHAH/AJAX code would need a method to attach behaviors to the new DOM elements. Thid is explained better on top of misc/drupal.js in 6.9:
If VBO doesn't provide a Drupal.behaviors implementation, then other modules have no method to attach your behaviors to the new DOM elements that they may have loaded, and that can include the whole view, or part of it. Hence other modules doing AHA/AJAX in views will brake VBO.
Comment #3
markus_petrux commentedIn #2 I forgot to mention that Drupal.vbo.ajaxViewResponse() would have to call Drupal.attachBehaviors(), maybe it could simply do as Drupal.Views.Ajax.ajaxViewResponse() in views/js/ajax_views.js. That way editablefields would have the oportunity to attach its own behaviors to the new DOM elements loaded by VBO's ajax feature.
Comment #4
infojunkieI checked in a fix in the latest dev. Please pull from CVS (DRUPAL-6--1 branch) or wait 12 hours before Drupal.org refreshes the release. The nice thing is that by declaring Drupal.behaviors.vbo, I was able to eliminate the whole ajaxViewResponse() hack altogether!
Comment #5
infojunkieFixed unless anyone says otherwise.
Comment #6
markus_petrux commentedYep: scmizer confirmed it works here:
http://drupal.org/node/359435#comment-1231352
Thank you! :)