JsonAPI bulk order autosuggest request leads to 404
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!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
JsonAPI bulk order autosuggest request leads to 404
Hi all,
on TYPO 11.5.29 and Aimeos 22.10.7 the following GET request leads to a 404 when trying to add a product via the bulk order form
https://dev.domain.com/jsonapi?ai[actio ... &ai[filter][||][0][=~][product.code]=99000009580&ai[filter][||][1][%3E][index.text:relevance(%22en%22,%2299000009580%22)]=0&ai[include]=attribute,text,price,product
Whereas the https://dev.domain.com/jsonapi?ai%5Bcontroller%5D=Url OPTIONS request for retrieving the resources works. So the basic routing configuration should be ok.
I will be able to upgrade to 23.7 in the near future but maybe I can backport something in case this should be a bug.
Best
Robert.
on TYPO 11.5.29 and Aimeos 22.10.7 the following GET request leads to a 404 when trying to add a product via the bulk order form
https://dev.domain.com/jsonapi?ai[actio ... &ai[filter][||][0][=~][product.code]=99000009580&ai[filter][||][1][%3E][index.text:relevance(%22en%22,%2299000009580%22)]=0&ai[include]=attribute,text,price,product
Whereas the https://dev.domain.com/jsonapi?ai%5Bcontroller%5D=Url OPTIONS request for retrieving the resources works. So the basic routing configuration should be ok.
I will be able to upgrade to 23.7 in the near future but maybe I can backport something in case this should be a bug.
Best
Robert.
Re: JsonAPI bulk order autosuggest request leads to 404
There seems to be a problem in TYPO3 setups only. In the Laravel demo it's working, in the TYPO3 demo not.
According to the JS error in the browser console, there's no valid JSON:API URL available for the (product) resource but the only difference seems to be that in TYPO3 the domain is missing in the OPTIONS response:
TYPO3 JSON:API OPTIONS response:
Laravel JSON:API OPTIONS response:
According to the JS error in the browser console, there's no valid JSON:API URL available for the (product) resource but the only difference seems to be that in TYPO3 the domain is missing in the OPTIONS response:
TYPO3 JSON:API OPTIONS response:
Code: Select all
product: "/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=product"
Code: Select all
product: "https://laravel.demo.aimeos.org/jsonapi/product"
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: JsonAPI bulk order autosuggest request leads to 404
At least in my setup the OPTIONS request returns an absolute URL scheme:
Code: Select all
"resources": {"attribute":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=attribute",
"basket":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=basket",
"catalog":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=catalog",
"customer":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=customer",
"locale":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=locale",
"order":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=order",
"product":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=product",
"review":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=review",
"site":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=site",
"service":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=service",
"stock":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=stock",
"supplier":"https:\/\/dev.domain.com\/jsonapi?ai%5Baction%5D=options&ai%5Bcontroller%5D=Jsonapi&ai%5Bresource%5D=supplier"}
Re: JsonAPI bulk order autosuggest request leads to 404
A follow up to my quick reply from Friday. I guess it‘s more like TYPO3 classifying it as not routable then. My first guess for a reason would be the nested GET array. I will try to debug that further to find the root cause.
Changing the nested filter array to a single query string might be a solution. Am I right in the assumption that this is all client side anyway?
Changing the nested filter array to a single query string might be a solution. Am I right in the assumption that this is all client side anyway?
Re: JsonAPI bulk order autosuggest request leads to 404
Simple solution for all cases in which it does not impose any security risks is setting to false.
For other cases one has to deal with TYPO3 routing and define some kind of exclusion or special treatment for the ai[filter] maybe via a PSR-15 request Middleware.
Code: Select all
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFoundOnCHashError']
For other cases one has to deal with TYPO3 routing and define some kind of exclusion or special treatment for the ai[filter] maybe via a PSR-15 request Middleware.