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

Comments

chr.fritsch created an issue. See original summary.

chr.fritsch’s picture

StatusFileSize
new629 bytes

Here is a patch

chr.fritsch’s picture

Status: Active » Needs review

Lets see what testbot says..

timmillwood’s picture

Issue tags: +Needs tests

Good find, but I guess we need a test for the fix.

timmillwood’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

After talking to @chr.fritsch on IRC I think this should be ok as it is.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Well 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

chr.fritsch’s picture

Status: Needs work » Needs review
StatusFileSize
new3.49 KB

I've now added a test

sam152’s picture

That is a whole lot of mocking, I think a kernel test might be worth using instead.

The last submitted patch, 8: add_readonly_to_field-2824912-8--test-only.patch, failed testing.

sam152’s picture

Title: Add readonly to field definition » The moderation_state field incorrectly reports being read-only
timmillwood’s picture

Status: Needs review » Reviewed & tested by the community

Either #7 or #8 work for me.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs tests

Committed and pushed fa34234 to 8.3.x and 6acb201 to 8.2.x. Thanks!

  • alexpott committed fa34234 on 8.3.x
    Issue #2824912 by Sam152, chr.fritsch, timmillwood: The moderation_state...

  • alexpott committed 6acb201 on 8.2.x
    Issue #2824912 by Sam152, chr.fritsch, timmillwood: The moderation_state...

Status: Fixed » Closed (fixed)

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