#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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

h3rj4n’s picture

h3rj4n’s picture

Status: Active » Needs review
FileSize
2.11 KB

Added to much. This is a cleaner patch.

h3rj4n’s picture

Issue summary: View changes
FileSize
2.82 KB

I 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.

ianthomas_uk’s picture

Priority: Normal » Critical

Setting 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.

Jeff Burnz’s picture

Status: Needs review » Needs work
+++ b/devel_node_access/devel_node_access.module
@@ -144,6 +144,21 @@ function devel_node_access_form_alter(&$form, $form_state, $form_id) {
+function devel_library_info() {

Function 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!

Jeff Burnz’s picture

Status: Needs work » Needs review
FileSize
3.03 KB

I 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.

anavarre’s picture

Patch applies successfully and I can confirm I'm not getting a WSOD any longer.

martin107’s picture

+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

martin107’s picture

Status: Needs review » Reviewed & tested by the community
moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

Code looks good so I went ahead and committed.

andyceo’s picture

Is it pushed? Can not see anything in repo...

andyceo’s picture

Sorry for noise, all is ok now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.