An error occurred while fetching the assigned milestone of the selected merge_request.
Return latest revision of content
1 unresolved thread
1 unresolved thread
Edited by Al Munnings
Merge request reports
Activity
added 1 commit
- Resolved by Al Munnings
- Resolved by Al Munnings
@almunnings This looks good to me overall!! I just have one question, but that should not tragically change the approach.
Not sure why my review comment isn't saving, but... do you have any concern with going to the database twice when the
$storage
is aTranslatableRevisionableStorageInterface
?$identifier = $storage->getLatestRevisionId($entity->id()); if ($storage instanceof TranslatableRevisionableStorageInterface) { $identifier = $storage->getLatestTranslationAffectedRevisionId($entity_id, $langcode) ?: $identifier; }
Edited by BRIAN STANNARD123 if (!$entity instanceof RevisionableInterface) { 124 return $entity; 125 }; 126 127 $entity_id = $entity->id(); 128 $entity_type_id = $entity->getEntityTypeId(); 129 130 // Set the default langcode to the current context language. 131 $langcode = $language ?: $context->getContextLanguage(); 132 133 // Quickly resolve the latest revision. 134 if (in_array($identifier, self::REVISION_LATEST)) { 135 /** @var \Drupal\Core\Entity\RevisionableStorageInterface $storage */ 136 $storage = $this->entityTypeManager->getStorage($entity_type_id); 137 138 $identifier = $storage->getLatestRevisionId($entity->id()); changed this line in version 5 of the diff
added 1 commit
- aa053e7a - I don't know if static:revision: does much here, removing
added 1 commit
- 74fd5b1e - Opportunity: Split apart the resolve/register methods as a lil cleanup.
enabled automatic add to merge train when the pipeline for 397896fe succeeds
Please register or sign in to reply