There are situations where you might always want a specific set of users to be added as reviewers or editors to items within a particular workflow. While you can manually add these participants, it's tedious. It would be much easier if content created within a given workflow could automatically inherit a set of users that could be tweaked from there, if necessary.

Comments

kevin.dutra created an issue. See original summary.

kevin.dutra’s picture

Status: Active » Needs review
StatusFileSize
new10.12 KB

Here's the first stab at this feature.

jhedstrom’s picture

This looks really great!

The only feedback I have is that since this implements some routes and link tabs, it would be good to have a quick functional test that just ensures the tabs and form are working as expected.

kevin.dutra’s picture

Good call, I already ran into an issue when trying to save if one of the fields is empty.

jhedstrom’s picture

Status: Needs review » Needs work
kevin.dutra’s picture

Status: Needs work » Needs review
StatusFileSize
new11.77 KB
new2.44 KB

Alrighty, here is the revised patch. This includes:

  1. New functional test for config form.
  2. Adjustment to max length of field for a little more room.
  3. Fix for error that occurred upon saving the form when one of the fields was empty.
jhedstrom’s picture

+++ b/modules/workflow_participants_auto/src/Form/WorkflowParticipantsForm.php
@@ -39,6 +39,7 @@
+        '#maxlength' => 256,

Won't this limit the number of users to names that can fit in 256 characters? Should this be #size instead?

kevin.dutra’s picture

Good point. I think I lifted a portion of the properties from elsewhere and didn't really think about it closely enough.

kevin.dutra’s picture

StatusFileSize
new11.94 KB
new809 bytes

Ah, now I remember the reason. The entity autocomplete form element caps the max length at 128 out of the box. Here's a slight adjustment that removes the cap entirely and bumps up the size of the field a bit.

  • jhedstrom committed d08329f on 8.x-2.x authored by kevin.dutra
    Issue #2932686 by kevin.dutra: Automatically add workflow participants...
jhedstrom’s picture

Status: Needs review » Fixed

Looks great. Thanks!

Status: Fixed » Closed (fixed)

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