Score:1

Is possible to add a field to content moderation's states?

br flag

I'm on D 9.4.x and using content moderation module.

Is possible to add a custom field to the states of the workflows\module?

E.g. add a boolean?

Score:2
ua flag

Out of the box? No.

You will have to create a custom module that adds such boolean field to your content types or entity types.

Via hook_form_alter you can use #ajax with #access OR alternatively use #states to show/hide the field when a different moderation state is selected.

Giuseppe avatar
br flag
Probably I was not clear, I'm trying to add the field to the state itself, e.g. to the `draft` state. The problem I'm facing it's that the code I found in internet about isn't working. I don't know if the reason is because the `core/modules/workflows/src/StateInterface.php` doesn't extends any other of the "entity" interfaces, or else.
No Sssweat avatar
ua flag
@Giuseppe That is because content moderation state is not a [fieldable entity](https://www.drupal.org/docs/7/api/field-api/making-an-entity-fieldable)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.