Commit 87d82c6e authored by Travis Tomka's avatar Travis Tomka Committed by Joël Pittet
Browse files

Issue #2166779 by droath, sergiocarracedo, MustangGB, Chris Matthews:...

Issue #2166779 by droath, sergiocarracedo, MustangGB, Chris Matthews: ctools_field_invoke_field doesn't create the $field_name or $field variables if the $field_name isn't an array
parent 4f4c4256
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -852,7 +852,7 @@ function ctools_page_token_processing($children, $elements) {
 * Add and remove CSS classes from the variables array. We use process so that
 * we alter anything added in the preprocess hooks.
 */
function ctools_process(&$variables, $hook) {
function discardKeyCodectools_process(&$variables, $hook) {
  if (!isset($variables['classes'])) {
    return;
  }
+5 −2
Original line number Diff line number Diff line
@@ -238,8 +238,6 @@ function ctools_field_label($field_name) {
function ctools_field_invoke_field($field_name, $op, $entity_type, $entity, &$a = NULL, &$b = NULL, $options = array()) {
  if (is_array($field_name)) {
    $instance = $field_name;
    $field = empty($field_name['field']) ? field_info_field($instance['field_name']) : $field_name['field'];
    $field_name = $instance['field_name'];
  }
  else {
    list(, , $bundle) = entity_extract_ids($entity_type, $entity);
@@ -250,6 +248,11 @@ function ctools_field_invoke_field($field_name, $op, $entity_type, $entity, &$a
    return;
  }

  // Keep the variables consistent regardless if we retrieve the field instance
  // ourself, or if one is provided to us via the $field_name variable.
  $field = field_info_field($instance['field_name']);
  $field_name = $instance['field_name'];

  // Merge default options.
  $default_options = array(
    'default' => FALSE,