3321805 - Path alias Entity made revisionable
3 unresolved threads
3 unresolved threads
Closes #3321805
Merge request reports
Activity
added 1 commit
- ec7b391f - 3321805 - Entity schema updates when data is present
added 1 commit
- 0638ff1d - 3321805 - Path alias tests removed unwanted user dependency
45 49 constraints: [ 46 50 'UniquePathAlias' => [], 47 51 ], 52 revision_metadata_keys: [ 53 'revision_user' => 'revision_uid', 54 'revision_created' => 'revision_timestamp', 55 'revision_log_message' => 'revision_log', 56 ], 48 57 )] 49 class PathAlias extends ContentEntityBase implements PathAliasInterface { 58 class PathAlias extends EditorialContentEntityBase implements PathAliasInterface { 50 59 51 60 use EntityPublishedTrait; 39 $reflector = new \ReflectionMethod($entityDefinitionUpdateManager, 'getChangeList'); 40 $reflector->setAccessible(TRUE); 41 $complete_change_list = $reflector->invoke($entityDefinitionUpdateManager); 42 if ($complete_change_list) { 43 // EntityDefinitionUpdateManagerInterface::getChangeList() only disables 44 // the cache and does not invalidate. In case there are changes, 45 // explicitly invalidate caches. 46 $entityTypeManager->clearCachedDefinitions(); 47 $entityFieldManager->clearCachedFieldDefinitions(); 48 } 49 $entity_type_id = 'path_alias'; 50 $change_list = $complete_change_list[$entity_type_id]; 51 $entity_type = $entityTypeManager->getDefinition($entity_type_id); 52 switch ($change_list['entity_type']) { 53 case EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED: 54 $entityTypeListener->onEntityTypeCreate($entity_type); changed this line in version 9 of the diff
@catch These are removed and post update hook is updated with only the relevant code needed to update the entity definitions. Please check
23 25 $entity_type = $update_manager->getEntityType('path_alias'); 24 26 $update_manager->updateEntityType($entity_type); 25 27 } 28 29 /** 30 * Update entity definitions, necessary if notices appear on site status page. 31 */ 32 function path_alias_post_update_entity_updates(): void { 33 $entityDefinitionUpdateManager = \Drupal::service('entity.definition_update_manager'); 34 $entityTypeManager = \Drupal::service('entity_type.manager'); 35 $entityFieldManager = \Drupal::service('entity_field.manager'); 36 $entityLastInstalledSchemaRepository = \Drupal::service('entity.last_installed_schema.repository'); 37 $fieldStorageDefinitionListener = \Drupal::service('field_storage_definition.listener'); 38 $entityTypeListener = \Drupal::service('entity_type.listener'); 39 $reflector = new \ReflectionMethod($entityDefinitionUpdateManager, 'getChangeList'); changed this line in version 9 of the diff
@catch These are removed and post update hook is updated with only the relevant code needed to update the entity definitions. Please check
added 1 commit
- 6d9a1583 - 3321805 | Path Alias updated the post update hook
added 1 commit
- 44928a14 - 3321805 | Path alias post update hook changes
added 1 commit
- a863d7fd - 3321805 | Path alias changed field in post update hook
Please register or sign in to reply