Update to Drupal 8.1.9. For more information, see https://www.drupal.org/project/drupal/releases/8.1.9
This commit is contained in:
parent
f9f23cdf38
commit
09b113657a
125 changed files with 2307 additions and 385 deletions
|
@ -81,9 +81,11 @@ class FileFieldItemList extends EntityReferenceFieldItemList {
|
|||
parent::delete();
|
||||
$entity = $this->getEntity();
|
||||
|
||||
// Delete all file usages within this entity.
|
||||
// If a translation is deleted only decrement the file usage by one. If the
|
||||
// default translation is deleted remove all file usages within this entity.
|
||||
$count = $entity->isDefaultTranslation() ? 0 : 1;
|
||||
foreach ($this->referencedEntities() as $file) {
|
||||
\Drupal::service('file.usage')->delete($file, 'file', $entity->getEntityTypeId(), $entity->id(), 0);
|
||||
\Drupal::service('file.usage')->delete($file, 'file', $entity->getEntityTypeId(), $entity->id(), $count);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue