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

  1. Install Varbase Components 4.0.x.
  2. Edit any view and set its exposed form style to "Component" (components_exposed_form).
  3. 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 extending ExposedFormPluginBase. It renders the view's exposed filter form through the selected Single Directory Component (a component_id plugin option), passing the whole exposed form into the component's filters slot. 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 — add views.exposed_form.components_exposed_form (mapping: component_id) and views.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 existing components_views_style style plugin.

Data model changes

  • Adds config schema for views.exposed_form.components_exposed_form and views.style.components_views_style. No existing config is changed.

Release notes snippet

  • Added the components_exposed_form views exposed form plugin and config schema for the component views plugins.
Command icon 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

rajab natshah created an issue. See original summary.

  • rajab natshah committed abc67778 on 4.0.x
    feat: #3611182 Add the components_exposed_form views exposed form plugin...

  • rajab natshah committed a37449fb on 4.0.x
    feat: #3611182 Add an always-show Reset option to the Components exposed...
rajab natshah’s picture

Assigned: Unassigned » josebc
Status: Active » Needs review
Issue tags: +varbase_components-4.0.0-beta4
rajab natshah’s picture

Assigned: josebc » mohammed j. razem
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rajab natshah’s picture

Issue tags: +varbase-11.0.0-rc1

✅ Released varbase-11.0.0-rc1

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.