Problem/Motivation

If an entity does not have langcode the results are empty when accessing the revisions. i.e. Profile entity. See #2634230: Remove langcode entity key

Proposed resolution

Do not verify the langcode when building the rows. I have attached a patch.

Here is the result:

Comments

marthinal created an issue. See original summary.

marthinal’s picture

bojanz’s picture

Status: Needs review » Needs work

NodeController has the same code, we need to be careful about removing it.
Might make more sense to add an additional check that skips the others when there's no langcode.

bradjones1’s picture

Status: Needs work » Needs review
StatusFileSize
new992 bytes

I had put a PR against this project a long time ago at https://github.com/fago/entity/pull/46/files but development moved back to d.o...

Here's a re-rolled version to kick off some discussion.

jsacksick’s picture

+++ b/src/Controller/RevisionControllerTrait.php
@@ -123,10 +123,11 @@ trait RevisionControllerTrait {
+    $translatable = reset($entity_revisions)->getEntityType()->isTranslatable();

Why not doing just this instead?

$translatable = $entity->getEntityType()->isTranslatable();
jsacksick’s picture

StatusFileSize
new1.17 KB

  • bojanz committed 9ba76e4 on 8.x-1.x
    Issue #2951528 by marthinal, jsacksick, bradjones1: Empty results for...
bojanz’s picture

Status: Needs review » Fixed

I'd usually prefer some test coverage, but this is blocking Profile, and I'm hoping we deprecate all of this once Drupal 8.8 is released and has its own revision UI.

Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.