Problem/Motivation
When a module providing a Views validation plugin is uninstalled, Views does not properly handle the missing plugin. Instead of displaying an error or warning, the Contextual Filters validation UI defaults to showing "Basic validation," even though the actual configuration file (.yml) still references the missing plugin.
This behavior is misleading because it makes users believe the validation is correctly set to "Basic validation" when, in reality, it is broken and still references the uninstalled plugin. This can lead to unexpected errors when saving or executing the View.
Steps to reproduce
- Install a module that provides a Views validation plugin (e.g.,
taxonomy_term_machine_name
).
- Create a View with a Contextual Filter and set its Validation Criteria to use the plugin provided by the module (
taxonomy_term_machine_name
).
- Save the View.
- Uninstall the module that provides the validation plugin (
taxonomy_term_machine_name
).
- Edit the View again and navigate to the Contextual Filter settings.
Expected Behavior:
- The UI should indicate that the previously selected validation plugin is missing.
- The user should be warned and prompted to select a valid replacement.
Actual Behavior:
- The UI misleadingly displays "Basic validation," even though the validation is broken in the configuration.
- The
.yml
configuration file still contains the reference to the missing plugin (taxonomy_term_machine_name
).
- The View throws errors when attempting to save changes to other areas of the configuration.
Proposed resolution
- Detect missing validation plugins in Views UI.
- If a contextual filter has a validation plugin that no longer exists, the UI should not default to "Basic validation."
- Instead, it should display an error or warning indicating that the plugin is missing.
- Provide a way to correct the issue.
- The user should be required to select a replacement validation option before saving.
- If no replacement is selected, the broken validation reference should be automatically removed from the View configuration upon saving.
Remaining tasks
- Investigate how Views currently handles missing plugins.
- Modify the Views UI to detect missing validation plugins.
- Implement a warning message when a missing validation plugin is detected.
- Provide a way to reset or replace the missing validation.
- Write tests to cover cases where a plugin is uninstalled.
User interface changes
- When a missing plugin is detected in a Contextual Filter, an error message should be displayed instead of silently defaulting to "Basic validation."
- A UI element should prompt users to select a new validation method or remove the invalid setting.
Introduced terminology
No new terminology is introduced.
API changes
No direct API changes, but Views' handling of missing plugins needs improvement.
Data model changes
None, but Views should ensure that missing plugin references are properly removed from the stored configuration.
Release notes snippet
Views now correctly detects missing validation plugins in Contextual Filters. If a View contains a reference to a validation plugin from an uninstalled module, an error message will be displayed, and users will be prompted to select a valid replacement instead of defaulting to "Basic validation."