Problem/Motivation

For the queue_unique module, we added a way to prefix a queue name like "queue_unique/node_updates" and override the core queue factory to give you a queue_unique instance instead of a default instance when you ask for that from the factory. https://www.drupal.org/project/queue_unique/issues/3301657

In the latest version of this module, I get the exception without even trying to add a new plugin - just visit the listing page.

In older version of the module, if I try to make a trivial subclass of Drupal\queue_ui\Plugin\QueueUI\DatabaseQueue to be able to inspect those queue items, I get an exception on the queue listing page /admin/config/system/queue-ui

In either case, the exception comes from the router:

Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "queueName" for route "queue_ui.inspect" must match "[^/]++" ("queue_unique/node_updates" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 203 of core/lib/Drupal/Core/Routing/UrlGenerator.php).
Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute('queue_ui.inspect', Object, Array, Array) (Line: 291)
Drupal\Core\Routing\UrlGenerator->generateFromRoute('queue_ui.inspect', Array, Array, 1) (Line: 105)
Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute('queue_ui.inspect', Array, Array, 1) (Line: 765)
Drupal\Core\Url->toString(1) (Line: 182)
Drupal\Core\Utility\LinkGenerator->generate(Object, Object) (Line: 95)
Drupal\Core\Render\Element\Link::preRenderLink(Array)
...

Steps to reproduce

Proposed resolution

using rawurlencode() on the queue name before passing as a route parameter doesn't work, unfortunately.

So, find another way to encode any "/" in the queue name (or url-safe base64 encode the whole name) and then decode whever it's used, such as \Drupal\queue_ui\Form\InspectForm::buildForm()

see also: https://symfony.com/doc/current/routing.html

Remaining tasks

add test

User interface changes

none

API changes

none

Issue fork queue_ui-3494639

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

pwolanin created an issue. See original summary.

pwolanin’s picture

Version: 3.1.5 » 3.2.x-dev
pwolanin’s picture

I tried to pas a url-encoded queue name into the url generator as the route parameter, but that wasn't working.

I could try again, but a 100% safe approach is using a base64 encoding for the queue name. I made what I think are all the needed changes.

pwolanin’s picture

Status: Active » Needs review

pwolanin’s picture

Issue summary: View changes
pwolanin’s picture

Title: Can't create a Queue UI plugin that works for queue names with "/" » Can't use Queue UI module if I have queue names with "/"
pwolanin’s picture

I should likely extend one of the tests to add a queue with a "/" at least

pwolanin’s picture

Issue summary: View changes

fjgarlin changed the visibility of the branch 3494639-cant-create-a to hidden.

fjgarlin’s picture

Just rebasing and tidying up MRs as the namespace fix was merged in another issue.

pwolanin’s picture

I updated one of the tests so that the plugin ID (and queue name) contain a slash to validate that it works with the fix.

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

voleger’s picture

Version: 3.2.x-dev » 4.0.x-dev
Status: Needs review » Reviewed & tested by the community

I'd move this fix/change to the next major version.

  • voleger committed 45bde343 on 4.0.x authored by pwolanin
    Issue #3494639 by pwolanin, voleger, fjgarlin: Can't use Queue UI module...
voleger’s picture

Fixed thanks

voleger’s picture

Anyone who needs that feature working now for 3.2.2, you can use this stable patch link
https://git.drupalcode.org/project/queue_ui/-/commit/45bde3430d9139ad600...

voleger’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

voleger’s picture