Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
This method gets the wrong entity type (the bundle entity type, not the entity type itself) and calls canModerateEntitiesOfEntityType instead of shouldModerateEntitiesOfBundle, meaning the alterations (if they worked) would apply to bundles not under moderation.
Proposed resolution
Fix this or as suggested in #2842042: Review, organise, and clean up content moderation handlers, remove it altogether.
Remaining tasks
Review.
User interface changes
None right now as the implementation is broken.
API changes
Removes a method on an interface.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#11 | 2843380-fix-bundle-alter-handler-11.patch | 4.88 KB | Sam152 |
#9 | interdiff-2843380-6-9-without-test.txt | 708 bytes | szato |
#9 | interdiff-2843380-6-9.txt | 1.95 KB | szato |
#9 | 2843380-fix-bundle-alter-handler-9.patch | 3.84 KB | szato |
#2 | 2843380-fix-bundle-alter-handler-2.patch | 2.76 KB | Sam152 |
Comments
Comment #2
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedHere is the fix, can write a test if it's decided to keep the method.
Comment #3
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedComment #4
timmillwoodI guess if this wasn't working, and nobody noticed, then we do need tests for it. As you said "if it'd decided to keep the method", I'm not sure we need it. I'd say just stick it in the form alter and remove it from the handler.
Comment #6
szato CreditAttribution: szato at Brainsum for Tieto commentedPatch updated to actual 8.4.x-dev code.
Comment #7
timmillwoodStill needs test ;)
Comment #8
szato CreditAttribution: szato at Brainsum for Tieto commentedComment #9
szato CreditAttribution: szato at Brainsum for Tieto commentedComment #10
szato CreditAttribution: szato at Brainsum for Tieto commentedComment #11
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedThis is possibly a follow-up, but it's annoying these values aren't enforced at the entity level. It would add more to the handler interface, which is bad, but at the same time this is kind of funky that you have to go an resave the bundle edit form for anything to happen, yet it's not actually broken in the meantime. It's also a config bundle-centric part of the handler interface.
I think perhaps we should just bite the bullet and remove this, I'm sure that's a solution @timmillwood can get on board with :)
Comment #12
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedSemi-related to #2803717: Allow 'syncing' content to be updated in content moderation without forcing the creation of a new revision.
Comment #13
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedComment #15
catchCommitted #2892967: \Drupal\content_moderation\EntityTypeInfo::formAlter() is half broken so closing this a duplicate.