$vid isn't defined and is throwing a php notice. The code is

  if ($vid) {
      $vocabulary = taxonomy_vocabulary_load($vid);
    }

    $tokens['terms-raw'] = implode(', ', $terms);
    $tokens['terms'] = check_plain($tokens['terms-raw']);
    $tokens['tids']  = implode(', ', $tids);
    $tokens['term-raw']  = $terms[0];
    $tokens['term']  = check_plain($tokens['term-raw']);
    $tokens['tid']   = $tids[0];
    $tokens['vocab'] = isset($vocabulary) ? $vocabulary->name : '';
    $tokens['vid']   = $vid;

    return $tokens;
  }
}

If this is changed to:

    if (isset($vid)) {
      $vocabulary = taxonomy_vocabulary_load($vid);
    }

    $tokens['terms-raw'] = implode(', ', $terms);
    $tokens['terms'] = check_plain($tokens['terms-raw']);
    $tokens['tids']  = implode(', ', $tids);
    $tokens['term-raw']  = $terms[0];
    $tokens['term']  = check_plain($tokens['term-raw']);
    $tokens['tid']   = $tids[0];
    $tokens['vocab'] = isset($vocabulary) ? $vocabulary->name : '';
    $tokens['vid']   = isset($vid);

    return $tokens;
  }
}

it goes away. If anyone else can reproduce this I'll write a patch.

I'm running:
php 5.3
d core 6.20
content taxonomy 6.x-1.x-dev

Comments

justadropofwater’s picture

Priority: Normal » Minor

Actually this is more like it:

   $tokens['tids']  = implode(', ', $tids);
    $tokens['term-raw']  = $terms[0] = NULL;
    $tokens['term']  = check_plain($tokens['term-raw']);
    $tokens['tid']   = $tids[0] = NULL;
    $tokens['vocab'] = isset($vocabulary) ? $vocabulary->name : '';

Also changing the priority since these are just notices...

DeFr’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of #1294408: PHP 5.3 notices on empty fields that contains a patch.