Révision 5e632cae
Ajouté par Assos Assos il y a plus de 3 ans
drupal7/sites/all/modules/field_collection/field_collection.entity.inc | ||
---|---|---|
127 | 127 |
public function translatedInstanceLabel($langcode = NULL) { |
128 | 128 |
if ($info = $this->instanceInfo()) { |
129 | 129 |
if (module_exists('i18n_field')) { |
130 |
return i18n_string("field:{$this->field_name}:{$info['bundle']}:label", $info['label'], array('langcode' => $langcode)); |
|
130 |
return i18n_string("field:{$this->field_name}:{$info['bundle']}:label", $info['label'], array('langcode' => $langcode, 'sanitize' => FALSE));
|
|
131 | 131 |
} |
132 | 132 |
return $info['label']; |
133 | 133 |
} |
... | ... | |
330 | 330 |
$query->entityCondition('entity_type', $entity_type); |
331 | 331 |
$query->entityCondition('entity_id', $hostEntity->{$key}); |
332 | 332 |
$query->entityCondition('bundle', $bundle); |
333 |
if (isset($entity_info['entity keys']['language'])) { |
|
334 |
$query->propertyCondition('language', $hostEntity->language); |
|
333 |
// Only filter by language if this entity type has a language key that |
|
334 |
// has a corresponding field in its base table. |
|
335 |
if (!empty($entity_info['entity keys']['language']) && !empty($entity_info['schema_fields_sql']['base table']) && in_array($entity_info['entity keys']['language'], $entity_info['schema_fields_sql']['base table'], TRUE)) { |
|
336 |
$query->propertyCondition($entity_info['entity keys']['language'], $hostEntity->{$entity_info['entity keys']['language']}); |
|
335 | 337 |
} |
336 | 338 |
} |
337 | 339 |
$query->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT'); |
... | ... | |
607 | 609 |
->fields(array('archived' => 1, 'revision_id' => $row['revision_id'])) |
608 | 610 |
->condition('item_id', $this->item_id) |
609 | 611 |
->execute(); |
612 |
|
|
613 |
// Let other modules know about the archived item. |
|
614 |
entity_get_controller('field_collection_item')->invoke('archive', $this); |
|
615 |
|
|
610 | 616 |
entity_get_controller('field_collection_item')->resetCache(array($this->item_id)); |
611 | 617 |
entity_revision_delete('field_collection_item', $this->revision_id); |
612 | 618 |
} |
... | ... | |
648 | 654 |
*/ |
649 | 655 |
public function __sleep() { |
650 | 656 |
$vars = get_object_vars($this); |
651 |
unset($vars['entityInfo'], $vars['idKey'], $vars['nameKey'], $vars['statusKey']); |
|
652 |
unset($vars['fieldInfo']); |
|
657 |
unset($vars['entityInfo'], $vars['idKey'], $vars['nameKey'], $vars['statusKey'], $vars['fieldInfo']); |
|
653 | 658 |
// Also do not serialize the host entity, but only if it has already an id. |
654 | 659 |
if ($this->hostEntity && ($this->hostEntityId || $this->hostEntityRevisionId)) { |
655 | 660 |
unset($vars['hostEntity']); |
Formats disponibles : Unified diff
Weekly update of contrib modules