Require Workbench Reviewer field

ky flag

For the project i'm working on, I am using content moderation and workbench_reviewer modules. This allows content authors to choose a reviewer (manager) for the next step in the publishing workflow who then receives an email.

The only issue is that by default the workbench reviewer module doesn't have an option to make the field required. For my project I need to make this a required field.

I have tried adding the below to hook_form_alter() but it doesn't seem to work for this field.


I would very much appreciate any help. Thanks!

sonfd avatar
in flag
Sometimes the top-level form items are containers for child items that are the actual form fields. You may need to dig a little deeper into `$form['workbench_reviewer']` to find the input element and mark it required there.
SteFairc avatar
ky flag
Thanks @sonfd I was able to set with `$form['workbench_reviewer']['widget']['#required']=TRUE;`
I sit in a Tesla and translated this thread with Ai:


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.