Tilde in Route aimeos_shop_tree

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
godadada@yahoo.com
Posts: 56
Joined: 15 Mar 2021, 01:03

Tilde in Route aimeos_shop_tree

Post by godadada@yahoo.com » 19 Apr 2022, 05:06

I have aimeos 2021.10/ubuntu complains about
"Missing required parameter for [Route: aimeos_shop_tree] [URI: shop/{site}/{f_name}~{f_catid}] [Missing parameter: f_name]."

the route is defined as following. i suspect something to do with tilde usage or miss-use. It is used as delimiter or bit negation. please enlighten if the following two places are all used correctly. also attached debug trace results.

Route::match( array( 'GET', 'POST' ), '{f_name}~{f_catid}', array(
'as' => 'aimeos_shop_tree',
'uses' => 'Aimeos\Shop\Controller\CatalogController@treeAction'
) )->where( ['site' => '[A-Za-z0-9\.\-]+', 'f_name' => '[^~]*'] );
Attachments
route.png
route.png (131 KiB) Viewed 741 times
missing f_name.png
missing f_name.png (219.15 KiB) Viewed 741 times

godadada@yahoo.com
Posts: 56
Joined: 15 Mar 2021, 01:03

Re: Tilde in Route aimeos_shop_tree

Post by godadada@yahoo.com » 23 Apr 2022, 08:38

I understand for the REG pattern matching for '[^~]*' but have no clue what tilde is doing in this '{f_name}~{f_catid}'.

Any input is appreciated.

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

Re: Tilde in Route aimeos_shop_tree

Post by aimeos » 23 Apr 2022, 19:55

The tilde is only a separator between two variables like any other character, e.g. "/".
Laravel complains that no value for f_name (even not an empty one) is passed when the URL should be generated. To fix it, check where in the template the URL is generated and add a this to the parameters passed to the method generating the URL:

Code: Select all

"f_name" => ''
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

godadada@yahoo.com
Posts: 56
Joined: 15 Mar 2021, 01:03

Re: Tilde in Route aimeos_shop_tree

Post by godadada@yahoo.com » 24 Apr 2022, 03:28

thanks for the tip. the DB is corrupted during dev. It is okay now after refreshing the DB.

Post Reply