* @ConfigEntityType(
* id = "view",
* label = @Translation("View", context = "View entity type"),
+ * label_collection = @Translation("Views", context = "View entity type"),
+ * label_singular = @Translation("view", context = "View entity type"),
+ * label_plural = @Translation("views", context = "View entity type"),
+ * label_count = @PluralTranslation(
+ * singular = "@count view",
+ * plural = "@count views",
+ * context = "View entity type",
+ * ),
* admin_permission = "administer views",
* entity_keys = {
* "id" = "id",
$display_duplicate = $displays[$old_display_id];
unset($display_duplicate['display_title']);
unset($display_duplicate['display_plugin']);
+ unset($display_duplicate['new_id']);
$displays[$new_display_id] = NestedArray::mergeDeep($displays[$new_display_id], $display_duplicate);
$displays[$new_display_id]['id'] = $new_display_id;
* An array containing display handlers of a view.
*
* @deprecated in Drupal 8.3.0, will be removed in Drupal 9.0.0.
+ *
+ * @see https://www.drupal.org/node/2831499
*/
private function fixTableNames(array &$displays) {
// Fix wrong table names for entity revision metadata fields.
views_invalidate_cache();
$this->invalidateCaches();
- // Rebuild the router if this is a new view, or it's status changed.
+ // Rebuild the router if this is a new view, or its status changed.
if (!isset($this->original) || ($this->status() != $this->original->status())) {
\Drupal::service('router.builder')->setRebuildNeeded();
}
'position' => 0,
'display_options' => [],
],
- ]
+ ],
];
}
public static function postDelete(EntityStorageInterface $storage, array $entities) {
parent::postDelete($storage, $entities);
- $tempstore = \Drupal::service('user.shared_tempstore')->get('views');
+ $tempstore = \Drupal::service('tempstore.shared')->get('views');
foreach ($entities as $entity) {
$tempstore->delete($entity->id());
}