Steps to reproduce:

  1. Enable hs_taxonomy
  2. Create a new vocabulary
  3. Replace name with name_field
  4. Create a new term

This happens in _hs_taxonomy_hierarchical_select_get_tree when the query returns no result. $terms remains null but that isn't checked when handling the Title support on line 1070 of hs_taxonomy.module.

CommentFileSizeAuthor
#2 hs-array_keys-2568067-1.patch780 byteslammensj
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LammensJ created an issue. See original summary.

lammensj’s picture

FileSize
780 bytes
lammensj’s picture

Status: Active » Needs review
hgoto’s picture

Status: Needs review » Reviewed & tested by the community

LammensJ, Thank you for the patch. I confirmed the error disappeared by using the patch #2. I think this issue is fixed.

This is another issue but the related code is as following:

<?php
  // Provide support for Title module. If Title module is enabled and this
  // vocabulary uses translated term names we want output those terms with their
  // translated version. Therefore a full taxonomy term entity load is required,
  // similar to taxonomy_get_tree().
  if (!empty($terms) && module_exists('title')) {
    $vocabulary = taxonomy_vocabulary_load($vid);
    if (title_field_replacement_enabled('taxonomy_term', $vocabulary->machine_name, 'name')) {
      $term_entities = taxonomy_term_load_multiple(array_keys($terms[$vid]));
    }
  }
?>

And the variables `$vocabulary` and `$term_entities` are never used after assignment...

stefan.r’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

  • stefan.r committed 978ec37 on authored by LammensJ
    Issue #2568067 by LammensJ: Array_keys notice when using Title in...

Status: Fixed » Closed (fixed)

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