Error: Parameter "ai__f_name" for route "ai_0" must match "[^/~]++" ("" given) to generate a corresponding URL.

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
gizmo
Posts: 24
Joined: 18 Jan 2021, 20:42

Error: Parameter "ai__f_name" for route "ai_0" must match "[^/~]++" ("" given) to generate a corresponding URL.

Post by gizmo » 23 Nov 2021, 10:06

In the error log I get the following Error:

Parameter "ai__f_name" for route "ai_0" must match "[^/~]++" ("" given) to generate a corresponding URL.
#0 /home/httpd/vhosts/frakmont.com/www/frakmont.com/frakmont.com/public/typo3/sysext/core/Classes/Routing/UrlGenerator.php(55): Symfony\Component\Routing\Generator\UrlGenerator->doGenerate(Array, Array, Array, Array, Array, 'ai_0', 1, Array, Array)

I can't 100% say how to reproduce the error. I got it after an update but it also appeared before the update.

I'm getting the error, when I try to open the Basket in the FE. In the FE I get the "an unrecoverable exception occured" and an the log I get the error above.

I've read the following Post ((Solved) Symfony\Component\Routing\Exception\InvalidParameterException) which is similar but not the same.

I've tried to remove the RoutEnhancers which fixed the Problem. Then I started to remove parts of the RouteEnhancer and after I removed the following Part of the RouteEnhancer the error was gone.

Code: Select all

      -
        routePath: '/b/{b_action}'
        _controller: 'Basket::index'
It works now, but i still don't know why the error occured and if its a bug or a configuration problem. Is this a TYPO3 Routing Problem?

I'm using:
TYPO3 10.4.21
Aimeos 21.10.2
PHP 7.4
Apache Webserver

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: Error: Parameter "ai__f_name" for route "ai_0" must match "[^/~]++" ("" given) to generate a corresponding URL.

Post by aimeos » 25 Nov 2021, 10:11

This seems to be one of those nasty TYPO3 routing bugs.
Can you create a bug report at https://forge.typo3.org ?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

gizmo
Posts: 24
Joined: 18 Jan 2021, 20:42

Re: Error: Parameter "ai__f_name" for route "ai_0" must match "[^/~]++" ("" given) to generate a corresponding URL.

Post by gizmo » 30 Nov 2021, 15:49

Okay I've added the bud report here: https://forge.typo3.org/issues/96165

I hope I've added all the neccessary information.

gizmo
Posts: 24
Joined: 18 Jan 2021, 20:42

Re: Error: Parameter "ai__f_name" for route "ai_0" must match "[^/~]++" ("" given) to generate a corresponding URL.

Post by gizmo » 04 Dec 2021, 15:58

I did some fruther testing and I've realised the route which make the error is actually the following

Code: Select all

      -
        routePath: '/c/{f_name}~{f_catid}'
        _controller: 'Catalog::list'
I don't know why it it did work when I tested it the first time. Maybe there was something haning left in the cache..

Anyways...

So after futher debugging, I found out, that the issue only occurs if I set a category on the catalog list plugin. If I choose a category then the f_name GET paramet is empty during the url building process.

the $params are set here (https://github.com/aimeos/ai-client-htm ... d.php#L395) which in my case is "null" and then it passes a "null" to the TYPO3 URL generator, which then throws an error.

I've set the settings.client.html.catalog.lists.catid-default config which doesn't make any difference.

Any ideas why this happens if I choose a category?

I assume this is not a typo3 urlGenerator problem, since aimeos delivery a value with "null" to the builder?

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: Error: Parameter "ai__f_name" for route "ai_0" must match "[^/~]++" ("" given) to generate a corresponding URL.

Post by aimeos » 06 Dec 2021, 11:05

Seems like the problem has been fixed a few days ago but it's not part of an official release yet:
https://github.com/aimeos/ai-client-htm ... 1d550cabec
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply