Problem/Motivation

When creating an endpoint, I run into the following error message:
Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "search_api_endpoint" for route "search_api_decoupled.filter_library" must match "[^/]++" ("" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (Line 209 in var/www/html/web/core/lib/Drupal/Core/Routing/UrlGenerator.php).

Steps to reproduce

I used this module already in several projects, this is the first time I get this bug, no matter what I do.
I assume it has something to do with the used versions of Drupal / PHP.
The following versions are in use:

  • PHP 8.2
  • Drupal 10.2
  • Search API Decoupled 1.0.0-alpha40

The error occurs on endpoint creation.

Proposed resolution

I show $form['filters_wrapper']['add_filter'] only, if the endpoint already exists. Otherwise $this->entity is not there. Patch is attached.

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

fabianrichter created an issue. See original summary.

a.dmitriiev’s picture

Thank you for reporting the bug. The filters feature was indeed recently added. The patch looks reasonable to me. I will add it now and release a new version as it is not possible to add new endpoints at the moment.

  • a.dmitriiev committed d0e224e2 on 1.x
    [#3556434] feat: Parameter "search_api_endpoint" for route...
    
a.dmitriiev’s picture

Status: Needs review » Fixed

Added the code to MR and merged. This will be part of alpha41 release.

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.

fabianrichter’s picture

Thank you!

Status: Fixed » Closed (fixed)

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