Problem/Motivation
Currently content_moderation is not playing together with scheduled_updates. One of the pittfalls is, that the definition of the moderation_state field returns TRUE for the read-only flag.
So IMHO this is wrong, because you are allowed to change the moderation_state value.
Proposed resolution
set readOnly to FALSE in the field definition
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | interdiff.txt | 5.69 KB | sam152 |
| #8 | add_readonly_to_field-2824912-8.patch | 3.07 KB | sam152 |
| #8 | add_readonly_to_field-2824912-8--test-only.patch | 1.93 KB | sam152 |
| #7 | add_readonly_to_field-2824912-7.patch | 3.49 KB | chr.fritsch |
| #2 | add_readonly_to_field-2824912-2.patch | 629 bytes | chr.fritsch |
Comments
Comment #2
chr.fritschHere is a patch
Comment #3
chr.fritschLets see what testbot says..
Comment #4
timmillwoodGood find, but I guess we need a test for the fix.
Comment #5
timmillwoodAfter talking to @chr.fritsch on IRC I think this should be ok as it is.
Comment #6
alexpottWell if this doesn't have a test it is likely we'll break it in #2779647: Add a workflow component, ui module, and implement it in content moderation - not sure what would be the best approach to testing though. Maybe some form of unit test of \Drupal\content_moderation\EntityTypeInfo::entityBaseFieldInfo
Comment #7
chr.fritschI've now added a test
Comment #8
sam152 commentedThat is a whole lot of mocking, I think a kernel test might be worth using instead.
Comment #10
sam152 commentedComment #11
timmillwoodEither #7 or #8 work for me.
Comment #12
alexpottCommitted and pushed fa34234 to 8.3.x and 6acb201 to 8.2.x. Thanks!
Comment #15
wim leersI think this fixed several of the fails in #2826101: Add a ReadOnly constraint validation and use it automatically for read-only entity fields.