Skip to content
Snippets Groups Projects

3321805 - Path alias Entity made revisionable

3 unresolved threads

Closes #3321805

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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);
  • 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');
  • added 1 commit

    • 6d9a1583 - 3321805 | Path Alias updated the post update hook

    Compare with previous version

  • added 1 commit

    • 6dc3d6d8 - 3321805 | PHPCS fixes path alias

    Compare with previous version

  • added 1 commit

    • 44928a14 - 3321805 | Path alias post update hook changes

    Compare with previous version

  • added 1 commit

    • a863d7fd - 3321805 | Path alias changed field in post update hook

    Compare with previous version

  • Please register or sign in to reply
    Loading