diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php index 610d474..9d7d3b0 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php @@ -242,6 +242,8 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + $this->clearBlockCacheDefinitions(); $storage_controller->deleteCategories(array($this->id() => $this)); } @@ -250,6 +252,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = FALSE) { + parent::postSave($storage_controller, $update); + if (!empty($this->categories)) { $storage_controller->saveCategories($this, $this->categories); } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php index c24ad1e..f0b6694 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php @@ -136,6 +136,8 @@ public function label($langcode = NULL) { * {@inheritdoc} */ public function postCreate(EntityStorageControllerInterface $storage_controller) { + parent::postCreate($storage_controller); + if (!isset($this->timestamp->value)) { $this->timestamp->value = REQUEST_TIME; } @@ -145,6 +147,8 @@ public function postCreate(EntityStorageControllerInterface $storage_controller) * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + $storage_controller->saveCategories($this); } @@ -152,6 +156,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::preDelete($storage_controller, $entities); + $storage_controller->deleteCategories($entities); } @@ -207,4 +213,5 @@ public static function baseFieldDefinitions($entity_type) { ); return $fields; } + } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php index 2f376d9..ca44a3a 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php @@ -191,6 +191,8 @@ public function uri() { * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + // Before saving the custom block, set changed time. $this->changed->value = REQUEST_TIME; } @@ -199,6 +201,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + // Invalidate the block cache to update custom block-based derivatives. \Drupal::service('plugin.manager.block')->clearCachedDefinitions(); } @@ -214,6 +218,8 @@ public function getInstances() { * {@inheritdoc} */ public function preSaveRevision(EntityStorageControllerInterface $storage_controller, \stdClass $record) { + parent::preSaveRevision($storage_controller, $record); + if ($this->isNewRevision()) { // When inserting either a new custom block or a new custom_block // revision, $entity->log must be set because {block_custom_revision}.log diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php index cb1a57e..3eeddb5 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php @@ -94,6 +94,8 @@ public function uri() { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + if (!$update) { entity_invoke_bundle_hook('create', 'custom_block', $this->id()); custom_block_add_body_field($this->id); @@ -107,8 +109,11 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + foreach ($entities as $entity) { entity_invoke_bundle_hook('delete', 'custom_block', $entity->id()); } } + } diff --git a/core/modules/block/lib/Drupal/block/Entity/Block.php b/core/modules/block/lib/Drupal/block/Entity/Block.php index e465455..99365ab 100644 --- a/core/modules/block/lib/Drupal/block/Entity/Block.php +++ b/core/modules/block/lib/Drupal/block/Entity/Block.php @@ -168,6 +168,8 @@ public function getExportProperties() { * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + $this->set('settings', $this->getPlugin()->getConfiguration()); } diff --git a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php index d46fb3d..e521a98 100644 --- a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php +++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php @@ -208,6 +208,8 @@ public function id() { * {@inheritdoc} */ public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { + parent::preCreate($storage_controller, $values); + if (empty($values['node_type']) && !empty($values['nid'])) { $node = node_load(is_object($values['nid']) ? $values['nid']->value : $values['nid']); $values['node_type'] = 'comment_node_' . $node->getType(); @@ -218,6 +220,8 @@ public static function preCreate(EntityStorageControllerInterface $storage_contr * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + global $user; if (!isset($this->status->value)) { @@ -307,6 +311,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + $this->releaseThreadLock(); // Update the {node_comment_statistics} table prior to executing the hook. $storage_controller->updateNodeStatistics($this->nid->target_id); @@ -329,6 +335,8 @@ protected function releaseThreadLock() { * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + $child_cids = $storage_controller->getChildCids($entities); entity_delete_multiple('comment', $child_cids); @@ -341,7 +349,6 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont * {@inheritdoc} */ public function permalink() { - $url['path'] = 'node/' . $this->nid->value; $url['options'] = array('fragment' => 'comment-' . $this->id()); diff --git a/core/modules/contact/lib/Drupal/contact/Entity/Category.php b/core/modules/contact/lib/Drupal/contact/Entity/Category.php index 7f633fc..f8b43fe 100644 --- a/core/modules/contact/lib/Drupal/contact/Entity/Category.php +++ b/core/modules/contact/lib/Drupal/contact/Entity/Category.php @@ -88,6 +88,8 @@ class Category extends ConfigEntityBase implements CategoryInterface { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + if (!$update) { entity_invoke_bundle_hook('create', 'contact_message', $this->id()); } @@ -100,6 +102,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + foreach ($entities as $entity) { entity_invoke_bundle_hook('delete', 'contact_message', $entity->id()); } diff --git a/core/modules/file/lib/Drupal/file/Entity/File.php b/core/modules/file/lib/Drupal/file/Entity/File.php index 833f2db..b891253 100644 --- a/core/modules/file/lib/Drupal/file/Entity/File.php +++ b/core/modules/file/lib/Drupal/file/Entity/File.php @@ -178,6 +178,8 @@ public static function preCreate(EntityStorageControllerInterface $storage_contr * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + $this->timestamp = REQUEST_TIME; $this->setSize(filesize($this->getFileUri())); if (!isset($this->langcode->value)) { @@ -193,6 +195,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::preDelete($storage_controller, $entities); + foreach ($entities as $entity) { // Delete all remaining references to this file. $file_usage = file_usage()->listUsage($entity); diff --git a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php index 71ca04d..19417a4 100644 --- a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php +++ b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php @@ -205,6 +205,8 @@ public function uri() { * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + $this->name = trim($this->label()); // @todo Do not save disabled filters whose properties are identical to @@ -224,6 +226,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + // Clear the static caches of filter_formats() and others. filter_formats_reset(); diff --git a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php index 4d12539..459c7c9 100644 --- a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php +++ b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php @@ -99,6 +99,8 @@ public function id() { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + if ($update) { if (!empty($this->original) && $this->id() !== $this->original->id()) { // The old image style name needs flushing after a rename. @@ -117,6 +119,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + foreach ($entities as $style) { // Flush cached media for the deleted style. $style->flush(); diff --git a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php index d6493f5..f27d051 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php @@ -390,6 +390,8 @@ public function offsetUnset($offset) { * {@inheritdoc} */ public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::preDelete($storage_controller, $entities); + // Nothing to do if we don't want to reparent children. if ($storage_controller->getPreventReparenting()) { return; @@ -411,6 +413,8 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + $affected_menus = array(); // Update the has_children status of the parent. foreach ($entities as $entity) { @@ -434,6 +438,8 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + // This is the easiest way to handle the unique internal path '', // since a path marked as external does not need to match a router path. $this->external = (url_is_external($this->link_path) || $this->link_path == '') ? 1 : 0; @@ -506,6 +512,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + // Check the has_children status of the parent. $storage_controller->updateParentalStatus($this); diff --git a/core/modules/node/lib/Drupal/node/Entity/Node.php b/core/modules/node/lib/Drupal/node/Entity/Node.php index f69bf1a..5105d29 100644 --- a/core/modules/node/lib/Drupal/node/Entity/Node.php +++ b/core/modules/node/lib/Drupal/node/Entity/Node.php @@ -79,6 +79,8 @@ public function getRevisionId() { * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + // Before saving the node, set changed and revision times. $this->changed->value = REQUEST_TIME; } @@ -87,6 +89,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public function preSaveRevision(EntityStorageControllerInterface $storage_controller, \stdClass $record) { + parent::preSaveRevision($storage_controller, $record); + if ($this->newRevision) { // When inserting either a new node or a new node revision, $node->log // must be set because {node_field_revision}.log is a text column and @@ -113,6 +117,8 @@ public function preSaveRevision(EntityStorageControllerInterface $storage_contro * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + // Update the node access table for this node, but only if it is the // default revision. There's no need to delete existing records if the node // is new. @@ -125,6 +131,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::preDelete($storage_controller, $entities); + if (module_exists('search')) { foreach ($entities as $entity) { search_reindex($entity->nid->value, 'node'); diff --git a/core/modules/node/lib/Drupal/node/Entity/NodeType.php b/core/modules/node/lib/Drupal/node/Entity/NodeType.php index cc6021c..c4ac5dd 100644 --- a/core/modules/node/lib/Drupal/node/Entity/NodeType.php +++ b/core/modules/node/lib/Drupal/node/Entity/NodeType.php @@ -171,6 +171,8 @@ public function isLocked() { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + if (!$update) { // Clear the node type cache, so the new type appears. \Drupal::cache()->deleteTags(array('node_types' => TRUE)); @@ -209,6 +211,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + // Clear the node type cache to reflect the removal. $storage_controller->resetCache(array_keys($entities)); foreach ($entities as $entity) { diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php b/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php index 6ff6936..e531917 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php @@ -87,6 +87,8 @@ public function uri() { * {@inheritdoc} */ public function postCreate(EntityStorageControllerInterface $storage_controller) { + parent::postCreate($storage_controller); + // Generate menu-compatible set name. if (!$this->getOriginalID()) { // Save a new shortcut set with links copied from the user's default set. @@ -111,6 +113,8 @@ public function postCreate(EntityStorageControllerInterface $storage_controller) * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + // Just store the UUIDs. foreach ($this->links as $uuid => $link) { $this->links[$uuid] = $uuid; @@ -121,6 +125,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + foreach ($this->links as $uuid) { if ($menu_link = entity_load_by_uuid('menu_link', $uuid)) { // Do not specifically associate these links with the shortcut module, @@ -137,11 +143,13 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::preDelete($storage_controller, $entities); + foreach ($entities as $entity) { $storage_controller->deleteAssignedShortcutSets($entity); // Next, delete the menu links for this set. menu_delete_links('shortcut-' . $entity->id()); - } } + } diff --git a/core/modules/system/lib/Drupal/system/Entity/Action.php b/core/modules/system/lib/Drupal/system/Entity/Action.php index c390a76..08a5d3d 100644 --- a/core/modules/system/lib/Drupal/system/Entity/Action.php +++ b/core/modules/system/lib/Drupal/system/Entity/Action.php @@ -178,10 +178,12 @@ public function getExportProperties() { return $properties; } - /** + /** * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + $plugin = $this->getPlugin(); // If this plugin has any configuration, ensure that it is set. if ($plugin instanceof ConfigurablePluginInterface) { diff --git a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php index 7762b88..0c3b261 100644 --- a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php +++ b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php @@ -167,6 +167,8 @@ public function isLocked() { * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + if ($this->hasLocales()) { $config_factory = \Drupal::service('config.factory'); $properties = $this->getExportProperties(); @@ -186,6 +188,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + // Clean up the localized entry if required. if (\Drupal::moduleHandler()->moduleExists('language')) { $languages = language_list(); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php index 4fb9b13..08b11f8 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php @@ -148,6 +148,8 @@ protected function init() { * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + // See if any of the term's children are about to be become orphans. $orphans = array(); foreach (array_keys($entities) as $tid) { @@ -177,6 +179,8 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + // Before saving the term, set changed time. $this->changed->value = REQUEST_TIME; } @@ -185,6 +189,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::preSave($storage_controller, $update); + // Only change the parents if a value is set, keep the existing values if // not. if (isset($this->parent->value)) { diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php index 8c20176..d0c6316 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php @@ -113,6 +113,8 @@ public function uri() { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + if (!$update) { entity_invoke_bundle_hook('create', 'taxonomy_term', $this->id()); } @@ -144,6 +146,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::preDelete($storage_controller, $entities); + // Only load terms without a parent, child terms will get deleted too. entity_delete_multiple('taxonomy_term', $storage_controller->getToplevelTids(array_keys($entities))); } @@ -152,6 +156,8 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + $vocabularies = array(); foreach ($entities as $vocabulary) { $vocabularies[$vocabulary->id()] = $vocabulary->id(); diff --git a/core/modules/user/lib/Drupal/user/Entity/Role.php b/core/modules/user/lib/Drupal/user/Entity/Role.php index 8529e87..61f6f2e 100644 --- a/core/modules/user/lib/Drupal/user/Entity/Role.php +++ b/core/modules/user/lib/Drupal/user/Entity/Role.php @@ -124,6 +124,8 @@ public function revokePermission($permission) { * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + if (!isset($this->weight) && ($roles = $storage_controller->loadMultiple())) { // Set a role weight to make this new role last. $max = array_reduce($roles, function($max, $role) { @@ -137,6 +139,9 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + $storage_controller->deleteRoleReferences(array_keys($entities)); } + } diff --git a/core/modules/user/lib/Drupal/user/Entity/User.php b/core/modules/user/lib/Drupal/user/Entity/User.php index 21accca..e0285d7 100644 --- a/core/modules/user/lib/Drupal/user/Entity/User.php +++ b/core/modules/user/lib/Drupal/user/Entity/User.php @@ -60,6 +60,8 @@ public function id() { * {@inheritdoc} */ static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { + parent::preCreate($storage_controller, $values); + if (!isset($values['created'])) { $values['created'] = REQUEST_TIME; } @@ -71,6 +73,8 @@ static function preCreate(EntityStorageControllerInterface $storage_controller, * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + parent::preSave($storage_controller); + // Update the user password if it has changed. if ($this->isNew() || ($this->pass->value && $this->pass->value != $this->original->pass->value)) { // Allow alternate password hashing schemes. @@ -101,6 +105,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + if ($update) { // If the password has been changed, delete all open sessions for the // user and recreate the current one. @@ -141,6 +147,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + $uids = array_keys($entities); \Drupal::service('user.data')->delete(NULL, $uids); $storage_controller->deleteUserRoles($uids); diff --git a/core/modules/views/lib/Drupal/views/Entity/View.php b/core/modules/views/lib/Drupal/views/Entity/View.php index b8e69bd..ce820ff 100644 --- a/core/modules/views/lib/Drupal/views/Entity/View.php +++ b/core/modules/views/lib/Drupal/views/Entity/View.php @@ -291,6 +291,8 @@ public function getExportProperties() { * {@inheritdoc} */ public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + parent::postSave($storage_controller, $update); + views_invalidate_cache(); } @@ -298,6 +300,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { + parent::preCreate($storage_controller, $values); + // If there is no information about displays available add at least the // default display. $values += array( @@ -317,6 +321,8 @@ public static function preCreate(EntityStorageControllerInterface $storage_contr * {@inheritdoc} */ public function postCreate(EntityStorageControllerInterface $storage_controller) { + parent::postCreate($storage_controller); + $this->mergeDefaultDisplaysOptions(); } @@ -324,6 +330,8 @@ public function postCreate(EntityStorageControllerInterface $storage_controller) * {@inheritdoc} */ public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + parent::postDelete($storage_controller, $entities); + $tempstore = \Drupal::service('user.tempstore')->get('views'); foreach ($entities as $entity) { $tempstore->delete($entity->id());