Révision dd54aff9
Ajouté par Assos Assos il y a plus de 10 ans
htmltest/sites/all/modules/entity/tests/entity_test.module | ||
---|---|---|
267 | 267 |
if (empty($node->entity)) { |
268 | 268 |
$node->entity = array('type' => 'user', 'id' => $node->uid); |
269 | 269 |
} |
270 |
|
|
270 | 271 |
// We have to return the entity wrapped. |
271 |
return entity_metadata_wrapper($node->entity['type'], $node->entity['id']); |
|
272 |
// Special handling for anonymous user. |
|
273 |
if ($node->entity['type'] === 'user' && empty($node->entity['id'])) { |
|
274 |
return entity_metadata_wrapper('user', drupal_anonymous_user()); |
|
275 |
} |
|
276 |
else { |
|
277 |
return entity_metadata_wrapper($node->entity['type'], $node->entity['id']); |
|
278 |
} |
|
272 | 279 |
} |
273 | 280 |
|
274 | 281 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules