Issue after updating from 2021.07 to 2021.10

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!
ritesh
Posts: 5
Joined: 29 Sep 2021, 10:41

Issue after updating from 2021.07 to 2021.10

Post by ritesh » 25 Feb 2022, 11:31

Hi,
I recently updated the aimeos laravel from 2021.07 to 2021.10, and on home page + other pages that doesn't have {site} parameter on the URL throws and exception:

Code: Select all

Illuminate\Routing\Exceptions\UrlGenerationException
Missing required parameter for [Route: aimeos_shop_jsonapi_options] [URI: {site}/jsonapi/{resource?}] [Missing parameter: site].
When I add "?site=default" on the URL then it works. I had to create a middleware that modifies the request and inserts the site parameter manually but now I realized it's not working for file requests for eg: "/fonts/poppins/poppins-v15-latin-regular.woff"

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

Re: Issue after updating from 2021.07 to 2021.10

Post by aimeos » 26 Feb 2022, 08:00

Yes, you need to add a value for "site" because your routes require it due to the "{site}/" part.
You shouldn't use a middleware to add the site code but just create a redirect from "/" to "/default" for example.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

ritesh
Posts: 5
Joined: 29 Sep 2021, 10:41

Re: Issue after updating from 2021.07 to 2021.10

Post by ritesh » 28 Feb 2022, 07:26

Is there an aimeos configuration or any other option to set the site code so I don't have to add the query parameters to the URL? Client doesn't want the ?site=default hanging on the end of the URL.


Laravel 8 with Aimeos 2021.10 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25

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

Re: Issue after updating from 2021.07 to 2021.10

Post by aimeos » 01 Mar 2022, 08:53

In multisite environments, the "site" must be part of the URL but it don't have to be "&site=default". Instead, you can use:
- yourdomain.com/<site>/shop with redirect of "/" to "/default/shop"
- <site>.yourdomain.com/shop
- yourdomain.com/shop, otherdomain.com/shop, etc.

See: https://aimeos.org/docs/latest/laravel/ ... he-routing
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply