Setting _admin_route for all forms steps route is too agressive.

Created on 15 July 2023, over 1 year ago

Problem/Motivation

If the "Use the administration theme when editing or creating content" appearance setting is enabled, the RouteSubscriber for this module will automatically set all forms_steps routes to be an _admin_route regardless of whether the route is for a node entity.

Normally, that setting is only applied to node operation routes (see \Drupal\node\EventSubscriber\NodeAdminRouteSubscriber). The way that \Drupal\forms_steps\EventSubscriber\RouteSubscriber::routes is written, if that setting is enabled it applied to all entity types, even custom ones.

This was implemented in #3104208: Using the admin theme for editing via 'Steps' β†’ .

We had to write a custom RouteSubscriber to undo the setting for our custom entities. Not a big deal, but might be confusing to some folks.

Proposed resolution

One of these could be a solution:

  1. Check if the forms_steps config is for a node entity type before using the node.settings.use_admin_theme setting value.
  2. Add an additional option to forms_steps configs to allow a "Use the administration theme" option on a per forms_steps basis.
✨ Feature request
Status

Active

Version

1.5

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States JonMcL Brooklyn, NY

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

Comments & Activities

Production build 0.71.5 2024