Commit 7673e58c authored by drewish's avatar drewish

Fixing some PHP warnings generating tokens.

parent ee08b9d9
......@@ -34,7 +34,8 @@ function filefield_token_list($type = 'all') {
* Provide the token values for a given file item.
*/
function filefield_token_values($type, $object = NULL) {
if ($type == 'field') {
$tokens = array();
if ($type == 'field' && isset($object[0]['fid'])) {
$item = $object[0];
$tokens['filefield-fid'] = $item['fid'];
$tokens['filefield-description'] = isset($item['data']['description']) ? $item['data']['description'] : '';
......@@ -60,6 +61,6 @@ function filefield_token_values($type, $object = NULL) {
$tokens['filefield-onlyname'] = $info['filename'];
$tokens['filefield-extension'] = $info['extension'];
}
return $tokens;
}
return $tokens;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment