Active
Project:
JS Alter
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2009 at 21:06 UTC
Updated:
25 Sep 2015 at 07:36 UTC
Jump to comment: Most recent
I've been trying to override Views' ajax_view.js for custom ajax functionality, so this seemed perfect. However, to my surprise, preprocess_views_view() (where Views puts its drupal_add_js() call runs after preprocess_page(), where JS Alter runs its hook. So the hook never sees the Views JS and therefore can't edit them.
I'm thinking there's not much that can be done here, but I do find it odd that it runs in this order -- shouldn't the view process before the page? -- and wondering if you've run into this and possibly found a workaround. (I guess there's always regexing $scripts, or just overriding the functions on the JS side.) Thanks!
Comments
Comment #1
mihai7221 commentedI know it's super late to reply to this, but maybe someone will use this information sometime.
You can try to change the modules weight, more information here. The modules weight represents the order in which a module hooks are executed.