Révision 503b3f7b
Ajouté par Assos Assos il y a environ 10 ans
drupal7/sites/all/modules/entity/includes/entity.wrapper.inc | ||
---|---|---|
758 | 758 |
elseif ($this->id === FALSE && !$this->data) { |
759 | 759 |
$this->updateParent(NULL); |
760 | 760 |
} |
761 |
elseif ($previous_id != $this->id) { |
|
761 |
elseif ($previous_id !== $this->id) {
|
|
762 | 762 |
$this->updateParent($this->id); |
763 | 763 |
} |
764 | 764 |
return $this; |
... | ... | |
824 | 824 |
*/ |
825 | 825 |
public function entityAccess($op, $account = NULL) { |
826 | 826 |
$entity = $this->dataAvailable() ? $this->value() : NULL; |
827 |
// The value() method could return FALSE on entities such as user 0, so we |
|
828 |
// need to use NULL instead to conform to the expectations of |
|
829 |
// entity_access(). |
|
830 |
if ($entity === FALSE) { |
|
831 |
$entity = NULL; |
|
832 |
} |
|
827 | 833 |
return entity_access($op, $this->type, $entity, $account); |
828 | 834 |
} |
829 | 835 |
|
... | ... | |
1038 | 1044 |
// Support setting lists of fully loaded entities. |
1039 | 1045 |
if ($this->isEntityList && $values && is_object(reset($values))) { |
1040 | 1046 |
foreach ($values as $key => $value) { |
1041 |
list($id, $vid, $bundle) = entity_extract_ids($this->itemType, $value); |
|
1042 |
$values[$key] = $id; |
|
1047 |
// Ignore outdated NULL value references in lists of entities. |
|
1048 |
if (isset($value)) { |
|
1049 |
list($id, $vid, $bundle) = entity_extract_ids($this->itemType, $value); |
|
1050 |
$values[$key] = $id; |
|
1051 |
} |
|
1043 | 1052 |
} |
1044 | 1053 |
} |
1045 | 1054 |
return parent::set($values); |
Formats disponibles : Unified diff
Weekly update of contrib modules