Problem/Motivation
Varbase Components ships the components_views_style views style plugin (src/Plugin/views/style/ComponentsViewsStyle.php), which renders a view's rows through a Single Directory Component (added in #3574244). Its natural counterpart — a components_exposed_form plugin that renders a view's exposed filters through an SDC — does not exist in the module. The config schema for either component views plugin is also missing.
As a result, any view whose exposed form is set to components_exposed_form throws a PluginNotFoundException and 500s on an otherwise clean install:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "components_exposed_form" plugin does not exist.and config validation has no schema for views.exposed_form.components_exposed_form or views.style.components_views_style.
This surfaced while building the events listing view for the Varbase Events Base recipe (#3610873), which wants both the rows and the exposed filters of the same view rendered through matching SDCs.
Steps to reproduce
- Install Varbase Components 4.0.x.
- Edit any view and set its exposed form style to "Component" (
components_exposed_form). - Save the view, then load a page that renders it.
Result: a PluginNotFoundException (the plugin does not exist), and drush config:export / config validation flags both component views plugins as having no schema.
Proposed resolution
Add the missing exposed-form plugin and the config schema for both component views plugins:
src/Plugin/views/exposed_form/ComponentsExposedForm.php— a#[ViewsExposedForm(id: 'components_exposed_form', ...)]plugin extendingExposedFormPluginBase. It renders the view's exposed filter form through the selected Single Directory Component (acomponent_idplugin option), passing the whole exposed form into the component'sfiltersslot. The component is only used once it is selected and resolvable; otherwise the exposed form renders as usual so a view keeps working while a theme is still being wired up.config/schema/varbase_components.schema.yml— addviews.exposed_form.components_exposed_form(mapping:component_id) andviews.style.components_views_style(mapping:component_id,rows_slot,prop_mappings).
Remaining tasks
- ✅ File an issue about this project
- ❌ Addition/Change/Update/Fix to this project
- ❌ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ❌ Reviewed by a human
- ❌ Code review by maintainers
- ❌ Full testing and approval
- ❌ Credit contributors
- ❌ Review with the product owner
- ❌ Update Release Notes
- ❌ Release
User interface changes
- N/A
API changes
- New views exposed form plugin
components_exposed_form(Drupal\varbase_components\Plugin\views\exposed_form\ComponentsExposedForm), the counterpart of the existingcomponents_views_stylestyle plugin.
Data model changes
- Adds config schema for
views.exposed_form.components_exposed_formandviews.style.components_views_style. No existing config is changed.
Release notes snippet
- Added the
components_exposed_formviews exposed form plugin and config schema for the component views plugins.
Issue fork varbase_components-3611182
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #6
rajab natshah✅ Released varbase_components-4.0.0-beta4
Comment #7
rajab natshahComment #8
rajab natshahComment #10
rajab natshah✅ Released varbase-11.0.0-rc1