After the un- and reinstall of the tour module one of its recipes is still shown as installed

Created on 19 October 2024, about 2 months ago

Problem/Motivation

Ran into probably an interesting edge case. For local testing i am using the composer template https://github.com/joachim-n/drupal-core-development-project byjoachim in combination with ddev. due to the symlinking that is used there i am unable to use neither "drupal recipe" nor " drush recipe" ( #1792310-258: Wrong DRUPAL_ROOT with non-standard code structure ). The only way i was able to apply a recipe was via project browser in the recipes tab. I've needed it for testing the tour module ( https://www.drupal.org/project/tour ) which moved its tour tips into recipes ( https://www.drupal.org/project/tour_core https://www.drupal.org/project/tour_core_language ). So i had the tour module installed, and both recipes composer projects required, and had applied the "tour_core" recipe via project browser in the UI. it worked worked like a charm. today i ran into some issues with a recent change in 11.x that lead into a WSOD for the tour module. One of the ways i tried to get things working again was uninstalling the tour module with drush pmu tour and reinstalling with drush en tour. So in consequence the tour tips list is stripped down to the three tour tips that ship with the tour module by default (which is the expected case) :

the only problem, on the recipes page of project browser, the tour_core recipe is still shown as installed:

Steps to reproduce

Proposed resolution

🐛 Bug report
Status

Active

Version

2.0

Component

User experience

Created by

🇩🇪Germany rkoller Nürnberg, Germany

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

  • Issue created by @rkoller
  • 🇩🇪Germany rkoller Nürnberg, Germany
  • 🇺🇸United States chrisfromredfin Portland, Maine

    Documenting here that the main reason for this is that the applied recipes are stored in state in "project_browser.applied_recipes"

    This happens in onApply in RecipeActivator.php

    So, this begs the question - what kinds of activities imply that a recipe no longer is considered "applied?" If a dependent module of a recipe is uninstalled, should that clear the state?

    Thinking broader, should we even be considered the recipe as "Applied" once and for all? My understanding is recipes are idempotent anyway, so can be applied and re-applied later if need be. If that's the case, I think it would be better to store a log of applications of a recipe, and simply show in the UI that this recipe has been applied at some point in the past. Right now, in fact, I believe that once a recipe is applied through the UI, it cannot be applied again through the UI, which is limiting for what recipes are supposed to do. I think it would be nice to instead store a list of timestamps of when a recipe was applied to the site, and let people view the log?

  • 🇺🇸United States chrisfromredfin Portland, Maine
  • 🇦🇺Australia pameeela

    Thinking broader, should we even be considered the recipe as "Applied" once and for all?

    No, in fact, we shouldn't -- there are some recipes that should be reapplied as needed. For example, the SEO tools recipe adds fields to content types. If you add a new content type, you would want to reapply the recipe to get the same fields on the new one.

    It is useful to know whether a recipe has been applied, but it shouldn't be a "final" thing.

Production build 0.71.5 2024