Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
While writing tests for #2875867: Add per-bundle unpublished content permissions I noticed that the EntityTestWithBundle
entity isn't revisionable even though it extends ContentEntityBase
, which implements RevisionableInterface
.
I'm not sure if it's intentional that this entity type doesn't declare a revisionable entity key or not, but if it's just an oversight, then it probably should be revisionable.
Proposed resolution
Declare the "revision" entity key.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#2 | 2886203-02.patch | 595 bytes | jhedstrom |
Comments
Comment #2
jhedstromComment #3
tstoecklerThe fact that it implements
RevisionableInterface
does not mean it should be revisionable. That is a bit unintuitive, but see also #2822611: Document why UserInterface + FileInterface + MenuLinkContentInterface + … extend \Drupal\Core\Entity\ContentEntityInterface where that fact is being documented more explicitly. So not sure about this issue.Comment #4
timmillwoodI'm not sure it *needs* to be revisionable.
In ContentModerationStateTest we make it revisionable on an ad-hoc basis for specific testing.
My concern is, are people using EntityTestWithBundle for tests now and depend on it not being revisionable.
Comment #5
jhedstromI wonder if we could increase the scope of this issue to do the following:
EntityTest
Comment #6
timmillwood@jhedstrom - sounds good to me. I think @sam152 had a patch somewhere which made a revisionable and bundleable test entity type, but ended up just making the current bundleable entity type revisionable in an ad-hoc way as you see in a couple of Content Moderation tests.
Comment #8
timmillwood