Many RouteBuilder::setRebuildNeeded() calls only occur when using the UI, not when using the configuration system

Created on 10 February 2017, almost 9 years ago
Updated 11 September 2025, 2 months ago

Problem/Motivation

Certain configuration changes need to trigger route rebuilds. But if those configuration changes are made through config deployment, they usually don't work.

Current calls to setRebuildNeeded() are in:

  1. \Drupal\Core\Extension\ThemeInstaller::resetSystem()
  2. \content_translation_form_language_content_settings_submit()
  3. \content_translation_language_configuration_element_submit()
  4. \field_ui_entity_bundle_create()
  5. \field_ui_entity_view_mode_presave()
  6. \field_ui_entity_form_mode_presave()
  7. \field_ui_entity_view_mode_delete()
  8. \field_ui_entity_form_mode_delete()
  9. \node_form_system_themes_admin_form_submit()
  10. \Drupal\search\Entity\SearchPage::postSave()
  11. \Drupal\system\SystemConfigSubscriber::onConfigSave()
  12. \views_invalidate_cache()
  13. \views_view_delete()
  14. \Drupal\views\Entity\View::postSave()

Only one of them (number 11) is in a ConfigEvents::SAVE event subscriber. This one is fine. Because it will work for both changes made through the UI and config deployments. This one is okay.

The calls made from config entities' post-save or post-delete methods are also okay. They are numbers 10 and 14. These are also okay.

Proposed resolution

TBD, see remaining tasks for now.

Remaining tasks

  1. Review all of these calls. Probably convert them to ConfigEvents::SAVE subscribers.
  2. Document the consequences of calling setRebuildNeeded(). This may trigger additional insights for this issue.
  3. TBD!

User interface changes

None, except that config deployments will now also cause the necessary route rebuilds!

API changes

TBD, likely none.

Data model changes

None.

📌 Task
Status

Postponed: needs info

Version

11.0 🔥

Component

routing system

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
  • Needs documentation

    A documentation change is requested elsewhere. For Drupal core (and possibly other projects), once the change has been committed, this status should be recorded in a change record node.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024