Recipes that provide content types should depend on the content_type_base recipe

Created on 22 October 2024, about 1 month ago

Problem/Motivation

We have several recipes that define content types (event, location, blog, page), and not all of them are using the drupal_cms_content_type_base recipe. This is a mistake; that recipe brings in important configuration without which the Node module cannot function, and ensures all content types are built from the same basic infrastructure.

Recipes that define content types should all apply drupal_cms_content_type_base first.

πŸ› Bug report
Status

Active

Component

General

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 131s
    #317123
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 247s
    #317126
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Assigning to @thejimbirch for review, since he is a co-maintainer of the recipe system and therefore is likely to spot anything I've missed here.

  • πŸ‡©πŸ‡ͺGermany breidert

    This would be great for the search recipe as well. We need to rely on certain fields that are available in all content types, so we can configure advanced search correctly.

    We have planned to let drupal_cms_search_base recipe to depend on drupal_cms_content_type_base. If all content types are depend on drupal_cms_content_type_base search will work for all content types out-of-the-box.

  • Pipeline finished with Canceled
    about 1 month ago
    Total: 223s
    #317154
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 65s
    #317160
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 229s
    #317162
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    OK, I reverted everything because there's a mess here where Pathauto is concerned.

    The Basic SEO recipe provides a generic Pathauto pattern for nodes that follows the menu hierarchy. But the content type recipes also provide Pathauto patterns, at the same weight as that generic one. We need to sort this out.

    My feeling is: the generic pattern should move to the drupal_cms_content_type_base recipe, and have a higher weight (i.e., more likely to "lose") than the patterns provided by the content types. To confirm it all works as expected, we need to have test coverage too.

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    I don't see the benefit of moving it. You would then have to require menu here which all content types do not need. I feel like you could just change the weight in the base seo recipe.

    I was mid review when things vanished on me. The only thing I could see would be the optional node views. You are calling them in the Drupal CMS base recipe and that is the only thing you need node there.

    This will also be the place to keep field storage configs to be used by all recipes.

  • Pipeline finished with Success
    about 1 month ago
    Total: 747s
    #317166
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    You would then have to require menu here which all content types do not need.

    Why would I need to require Menu? Presumably the pattern will just fall back to /title-of-node if no menu hierarchy exists?

  • Pipeline finished with Failed
    about 1 month ago
    Total: 467s
    #317182
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Re #6: that's a fair enough point, overall.

    How about this:

    • drupal_cms_content_type_base no longer provides Pathauto or any configuration for it.
    • The Basic SEO recipe stays as-is but the weight of the pattern is increased so that it acts like a fallback, relative to the content type recipes.
    • Each content type recipe provides Pathauto, the related configuration, and test coverage to ensure it doesn't conflict with the Basic SEO recipe.
  • Pipeline finished with Failed
    about 1 month ago
    Total: 518s
    #317196
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 312s
    #317211
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Looks good. Marking as RTBC assuming tests will pass.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Failed
    about 1 month ago
    Total: 566s
    #317222
  • Pipeline finished with Failed
    about 1 month ago
    Total: 635s
    #317240
  • Pipeline finished with Failed
    about 1 month ago
    Total: 829s
    #317271
  • Pipeline finished with Success
    about 1 month ago
    Total: 792s
    #317297
  • Pipeline finished with Skipped
    about 1 month ago
    #317314
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Nice to clean this up, and establish a solid pattern for other content type recipes to follow.

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

Production build 0.71.5 2024