Problem/Motivation
I'm trying to set up Recurring Events for a library system. It is a very attractive module because our staff input lots of event series, but then want to override titles, images, descriptions, tags, etc. We need a basic publishing workflow where submitters can add events for review (but not publish), approvers can review and approve events, and a special "cancel" role can mark certain instances canceled.
Our first trial of Recurring Events + Content Moderation used one workflow that was applied to both eventseries and eventinstance. Things worked well with one exception. We did NOT want staff to be allowed to change the moderation state of an instance unless it was being marked canceled.
Our second trial, we tried Recurring Events + Content Moderation with two workflows thinking we could solve the access issue with permissions. But our ability to edit instances fell apart. This seems to happen when series and instance bundles are assigned to different workflow IDs, even if the states and transitions are identical by name.
Steps to reproduce
Environment: Drupal 11 with Recurring Events 3.0.0-alpha1, Content Moderation 11.4.11, Workflows 11.4.11.
1. Install Recurring Events, Content Moderation, and Workflows module.
2. Set up two workflows with identical steps and transitions. Apply one workflow to eventseries and one workflow to eventinstance.
3. Create a series event in draft as a submitter role. Edit some instances. Submit for approval, so move from draft to pending review state.
4. Publish the event as an approver to move from pending review to published state.
5. Observe that all of the instances are still in a draft state. I ended up with a series with no visible instances.
Proposed resolution
I'm proposing an update to the documentation that makes it clear that, if using content moderation and workflows, the eventseries and eventinstance entities must use the same workflow if using content moderation. I looked for this requirement and didn't see it in documentation, but I did find it as a comment in code.
I'm also seeking advice on what the best path forward is if we want to use Recurring Events. If I can't make cancelation work, we will have to pivot to a different solution. Right now, my only thought is a custom module that uses form alter to hide unwanted transition options from the state dropdown based on the user's role. Would that be the cleanest way to preserve content moderation and prevent staff from changing the states of instances to anything other than published->canceled or canceled->published?
Comments