Révision 503b3f7b
Ajouté par Assos Assos il y a environ 10 ans
drupal7/sites/all/modules/entity/entity_token.tokens.inc | ||
---|---|---|
180 | 180 |
$wrapper = !isset($wrapper) ? _entity_token_wrap_data($type, $token_types[$type], $data[$type], $options) : $wrapper; |
181 | 181 |
$property_name = str_replace('-', '_', $name); |
182 | 182 |
try { |
183 |
$replacement = _entity_token_get_token($wrapper->$property_name, $options); |
|
184 |
if (isset($replacement)) { |
|
185 |
$replacements[$original] = $replacement; |
|
183 |
if (isset($wrapper->$property_name)) { |
|
184 |
$replacement = _entity_token_get_token($wrapper->$property_name, $options); |
|
185 |
if (isset($replacement)) { |
|
186 |
$replacements[$original] = $replacement; |
|
187 |
} |
|
186 | 188 |
} |
187 | 189 |
} |
188 | 190 |
catch (EntityMetadataWrapperException $e) { |
... | ... | |
294 | 296 |
*/ |
295 | 297 |
function _entity_token_get_token($wrapper, $options) { |
296 | 298 |
|
297 |
if ($wrapper->value() === NULL) { |
|
299 |
if (!$wrapper || $wrapper->value() === NULL) {
|
|
298 | 300 |
// Do not provide a replacement if there is no value. |
299 | 301 |
return NULL; |
300 | 302 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules