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.
This lines invoke php notice about undefined array offset
$vids = array_intersect(array_keys($node->taxonomy), $hs_vids);
if (!empty($vids)) {
$vid = $vids[0];
$values['save-lineage-termpath'] = $values["save-lineage-termpath:$vid"];
$values['save-lineage-termpath-raw'] = $values["save-lineage-termpath-raw:$vid"];
}
That's because array_intersect save keys of array.
The result of
var_dump(array_intersect(array('a','b'), array('b')));
Will be
array(1) {
[1]=>
string(1) "b"
}
So in this case 0 - is undefined offset of resulting array.
If in this place needed just get first vid, i propose use array_shift().
Comment | File | Size | Author |
---|---|---|---|
fix-php-notice.patch | 673 bytes | IRuslan | |
Comments
Comment #1
stefan.r CreditAttribution: stefan.r commented6.x issue without activity for over 3 years, closing.
Please reopen if this is still an issue in 7.x.