diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-16 05:15:21 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-16 05:15:21 +0000 |
commit | 19fb7786167347e7509aeb9569a19674f6a31f6b (patch) | |
tree | 27e5a2f8fb44e9171d6226d5c8929509ed7966c5 /includes | |
parent | 2d1ef531dcca714d60bd2f61927d85a9b77d4957 (diff) | |
download | brdo-19fb7786167347e7509aeb9569a19674f6a31f6b.tar.gz brdo-19fb7786167347e7509aeb9569a19674f6a31f6b.tar.bz2 |
#615656 by catch: Remove no-op function calls from drupal_render().
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/includes/common.inc b/includes/common.inc index 7adc5bc47..7e26ad4c7 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -3958,10 +3958,6 @@ function drupal_get_js($scope = 'header', $javascript = NULL) { * @see drupal_render(). */ function drupal_process_attached($elements, $weight = JS_DEFAULT, $dependency_check = FALSE) { - // If there is nothing to process then return. - if (empty($elements['#attached'])) { - return; - } // Add defaults to the special attached structures that should be processed differently. $elements['#attached'] += array( 'library' => array(), @@ -4060,13 +4056,11 @@ function drupal_process_attached($elements, $weight = JS_DEFAULT, $dependency_ch * @endcode */ function drupal_process_states(&$elements) { - if (!empty($elements['#states'])) { - $elements['#attached']['js']['misc/states.js'] = array('weight' => JS_LIBRARY + 1); - $elements['#attached']['js'][] = array( - 'type' => 'setting', - 'data' => array('states' => array('#' . $elements['#id'] => $elements['#states'])), - ); - } + $elements['#attached']['js']['misc/states.js'] = array('weight' => JS_LIBRARY + 1); + $elements['#attached']['js'][] = array( + 'type' => 'setting', + 'data' => array('states' => array('#' . $elements['#id'] => $elements['#states'])), + ); } /** @@ -5019,11 +5013,15 @@ function drupal_render(&$elements) { } // Add any JavaScript state information associated with the element. - drupal_process_states($elements); + if (!empty($elements['#states'])) { + drupal_process_states($elements); + } // Add additional libraries, CSS, JavaScript an other custom // attached data associated with this element. - drupal_process_attached($elements); + if (!empty($elements['#attached'])) { + drupal_process_attached($elements); + } $prefix = isset($elements['#prefix']) ? $elements['#prefix'] : ''; $suffix = isset($elements['#suffix']) ? $elements['#suffix'] : ''; |