Problem/Motivation

If you activate multiple recipes that have inputs, it...doesn't work. You'll be redirected to an input form for the first one, but not the others.

Proposed resolution

TBD, but probably we should redirect to a single form that knows which recipes you're trying to activate, and thus collects inputs for, and applies, all of them at once.

This will probably necessitate some backwards compatible changes in the activator system. We need some way for activators to indicate that they will process multiple projects at once. I discovered that we can keep ActivatorInterface as-is and do this in implementations:

public function activate(Project ...$projects): ?array { ... }

This would be an entirely reasonable way for an activator to show that it will handle, in one call, every project that it supports. Both ModuleActivator and RecipeActivator could implement this. This would allow RecipeActivator to redirect to RecipeForm once and handle several recipes.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue tags: +stable blocker, +backport

phenaproxima’s picture

It might be worth postponing this on #3509738: If a module installs additional dependencies, they should show up as installed right away, since that will remove the inline project refresh that necessitates a weird dependency injection-related workaround.

phenaproxima’s picture

Title: When multiple recipes with inputs are activated, show all their inputs in a single form » [PP-1] When multiple recipes with inputs are activated, show all their inputs in a single form
Status: Active » Postponed
phenaproxima’s picture

Issue tags: +Needs tests

This is gonna need explicit test coverage.

phenaproxima’s picture

Issue tags: -Needs tests
phenaproxima’s picture

Title: [PP-1] When multiple recipes with inputs are activated, show all their inputs in a single form » [PP-2] When multiple recipes with inputs are activated, show all their inputs in a single form
Related issues: +#3539389: RecipeForm doesn't set a checkpoint

Also postponing on #3539389: RecipeForm doesn't set a checkpoint, since the logic change there will affect this issue.

phenaproxima’s picture

Title: [PP-2] When multiple recipes with inputs are activated, show all their inputs in a single form » [PP-1] When multiple recipes with inputs are activated, show all their inputs in a single form

OK, one blocker in!

phenaproxima’s picture

Title: [PP-1] When multiple recipes with inputs are activated, show all their inputs in a single form » When multiple recipes with inputs are activated, show all their inputs in a single form
Status: Postponed » Needs work

And there goes the other blocker.

phenaproxima’s picture

Assigned: Unassigned » chrisfromredfin
Status: Needs work » Needs review

Assigning to the guy who will manually test and hopefully commit this bad boy. :) I still need to do a second MR to backport to 2.0.x.

chrisfromredfin’s picture

Status: Needs review » Needs work

Found an issue that if you apply three recipes and only two require config, it gives you the wrong titles on the fieldsets in the modal. To replicate, select article tags, AI assistant, and website contact form. (I'm not sure if order matters.) Test may need to be either improved or written.

phenaproxima’s picture

Status: Needs work » Needs review

Nice catch. Fixed the bug and adjusted the tests. Turns out that order of selection was significant.

chrisfromredfin’s picture

Status: Needs review » Fixed

easy and cooooollllll

Status: Fixed » Closed (fixed)

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