Problem/Motivation

Currently the Vertex search plugin in this module doesn't provide a schema.yml file. This means that the schema cannot be validated.
Also a number of boolean configuration fields are stored as integers instead of as booleans; a schema can help with this.
Finally, the search page entity values of id, label, path, and plugin are duplicated in the exported configuration for the search page.

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

jastraat created an issue. See original summary.

jastraat’s picture

Title: Provide a schema for schema validation and improve config typing » Provide a schema for validation and improve config typing
jastraat’s picture

Version: 1.12.0 » 1.0.x-dev
jastraat’s picture

Version: 1.0.x-dev » 1.12.0
Category: Feature request » Bug report

I re-added the duplicate configuration of the id and label from the search entity because it would require refactoring the module; the module uses those values from the plugin configuration, not the search entity.

In analyzing the new schema against exported config data, I think there's still an issue with js_config.

Based on my experience refactoring the facets module, I think the problem will require reconsidering how that value is stored. Right now it doesn't fall nicely into sequence or mapping types.

sequence - can't be an associative array.
mapping - needs predictable keys specified in the schema.

Right now the code is storing that configuration as an associative array with variable keys which unfortunately doesn't fit into one of the above. It also looks like the full search page configuration is being stored a second time within this value? I also can't find where the configuration variable is actually used. Is that configuration still needed? We don't use this functionality, so ideally a site that does would take a look.

$js_config = [];
    foreach ($enabled as $plugin_id) {
      if ($this->jsPluginManager->hasDefinition($plugin_id)) {
        $instance = $this->jsPluginManager->createInstance($plugin_id, $this->configuration);
        $instance->submitConfigurationForm($form, $form_state);
        $js_config[$plugin_id] = $instance->getConfiguration();
      }
    }
    $this->configuration['js_config'] = $js_config;

I found https://www.drupal.org/project/config_inspector useful when looking at the results -

jastraat’s picture

Status: Active » Needs review

timozura made their first commit to this issue’s fork.

timozura’s picture

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.

Status: Fixed » Closed (fixed)

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