Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
#2168113: Add leading underscore and other discouragement to drupal_add_css() and drupal_add_js() is commited to core so the function drupal_add_js is renamed to _drupal_add_js. This breaks devel so I fixed this.
I changed two things:
1. In devel.module renamed drupal_add_js
to _drupal_add_js
because there is no way to add a javascript to the render array in an event callback where the function has_krumo
is called.
Edit: Changed this so that it's added on the page_alter hook.
2. Removed drupal_add_js in devel_node_access and replaced it with the attached on the render array.
Comment | File | Size | Author |
---|---|---|---|
#6 | devel-changed_drupal_add_js-2169227-4.patch | 3.03 KB | Jeff Burnz |
#3 | devel-changed_drupal_add_js-2169227-3.patch | 2.82 KB | h3rj4n |
Comments
Comment #1
h3rj4n CreditAttribution: h3rj4n commentedComment #2
h3rj4n CreditAttribution: h3rj4n commentedAdded to much. This is a cleaner patch.
Comment #3
h3rj4n CreditAttribution: h3rj4n commentedI changed the way the javascript library is added. It'll now be added on the hook_page_alter. Removed it from has_krumo function so that it can be attached on the renderable array.
Comment #4
ianthomas_ukSetting to critical as this causes a fatal error on the homepage when devel is enabled. I can confirm that #3 fixes the fatal error, but I've not tested that it's still including the JS in the appropriate places.
It's already been fixed in #3, but for the benefit of anyone doing similar conversions, _drupal_add_js must not be called from contrib. See https://drupal.org/node/2169605 for more info.
Comment #5
Jeff Burnz CreditAttribution: Jeff Burnz commentedFunction name is incorrect, its being declared twice, can we just add both libs in one hook_library_info() or change to devel_node_access_library_info()
Otherwise great, really needed this!
Comment #6
Jeff Burnz CreditAttribution: Jeff Burnz commentedI see now its just a mistake in function name and the node access library is used in DnaUser.php, renamed the function but not tested devel node access module.
Comment #7
anavarrePatch applies successfully and I can confirm I'm not getting a WSOD any longer.
Comment #8
martin107 CreditAttribution: martin107 commented+1 on patch #6
It clears my WSOD. Patch address the problem and the problem only .. and is a clean implementation
Not much else to say
Comment #9
martin107 CreditAttribution: martin107 commentedComment #10
moshe weitzman CreditAttribution: moshe weitzman commentedCode looks good so I went ahead and committed.
Comment #11
andyceo CreditAttribution: andyceo commentedIs it pushed? Can not see anything in repo...
Comment #12
andyceo CreditAttribution: andyceo commentedSorry for noise, all is ok now.