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:
\Drupal\Core\Extension\ThemeInstaller::resetSystem()
\content_translation_form_language_content_settings_submit()
\content_translation_language_configuration_element_submit()
\field_ui_entity_bundle_create()
\field_ui_entity_view_mode_presave()
\field_ui_entity_form_mode_presave()
\field_ui_entity_view_mode_delete()
\field_ui_entity_form_mode_delete()
\node_form_system_themes_admin_form_submit()
\Drupal\search\Entity\SearchPage::postSave()
\Drupal\system\SystemConfigSubscriber::onConfigSave()
\views_invalidate_cache()
\views_view_delete()
\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
- Review all of these calls. Probably convert them to
ConfigEvents::SAVE
subscribers. - Document the consequences of calling
setRebuildNeeded()
. This may trigger additional insights for this issue. - 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.
Comments
Comment #2
Wim LeersAs part of this issue, we should also document the consequences of calling
setRebuildNeeded()
. Doing so may trigger further insights in how to proceed in this issue. (Thanks to #2815845-78: Importing (deploying) REST resource config entities should automatically do the necessary route rebuilding for asking for this.)