FreeShipping and Category throws SQL error

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!
snicto
Posts: 37
Joined: 12 Oct 2022, 14:00

FreeShipping and Category throws SQL error

Post by snicto » 27 Mar 2023, 17:02

We were trying to create FreeShipping for a specific category. However, it seems to be throwing an SQL error. Could you point me to the culprit in this instance? It is throwing errors only with category extension enabled.

Code: Select all

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND mproli."id" IS NOT NULL ) AND ( ( mpro."status" = 1 ) AND ( mpro."type"...' at line 14:
SELECT
mpro."id" AS "product.id", mpro."siteid" AS "product.siteid",
mpro."type" AS "product.type", mpro."code" AS "product.code",
mpro."label" AS "product.label", mpro."url" AS "product.url",
mpro."start" AS "product.datestart", mpro."end" AS "product.dateend",
mpro."status" AS "product.status", mpro."ctime" AS "product.ctime",
mpro."mtime" AS "product.mtime", mpro."editor" AS "product.editor",
mpro."target" AS "product.target", mpro."dataset" AS "product.dataset",
mpro."scale" AS "product.scale", mpro."config" AS "product.config",
mpro."rating" AS "product.rating", mpro."ratings" AS "product.ratings",
mpro."instock" AS "product.instock"
FROM "mshop_product" mpro
LEFT JOIN "mshop_product_list" AS mproli ON ( mproli."parentid" = mpro."id" )
WHERE ( ( mpro."siteid" IN ('','1.') ) AND ( ( ( mproli."siteid" IN ('','1.') ) AND () AND mproli."id" IS NOT NULL ) AND ( ( mpro."status" = 1 ) AND ( mpro."type" = 'event' OR mpro."start" IS NULL OR mpro."start" = '2023-03-27 12:13:00' ) ) ) )
GROUP BY mpro."id", mpro."id"
ORDER BY mpro."id" ASC
LIMIT 100 OFFSET 0

#0 /vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Base.php(522): Aimeos\Base\DB\Statement\DBAL\Simple->execute()
#1 /vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Base.php(904): Aimeos\MShop\Common\Manager\Base->getSearchResults()
#2 /vendor/aimeos/aimeos-core/src/MShop/Product/Manager/Standard.php(1050): Aimeos\MShop\Common\Manager\Base->searchItemsBase()
#3 /vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Depth.php(59): Aimeos\MShop\Product\Manager\Standard->search()
#4 /vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Lazy.php(38): Aimeos\MShop\Common\Manager\Decorator\Depth->search()
#5 /vendor/aimeos/map/src/Map.php(4938): Aimeos\MShop\Common\Manager\Decorator\Lazy->Aimeos\MShop\Common\Manager\Decorator\closure()
#6 /vendor/aimeos/map/src/Map.php(5001): Aimeos\Map->array()
#7 /vendor/aimeos/map/src/Map.php(2434): Aimeos\Map->list()
#8 /vendor/aimeos/aimeos-core/src/MShop/Coupon/Provider/Decorator/Category.php(152): Aimeos\Map->isEmpty()
#9 /vendor/aimeos/aimeos-core/src/MShop/Coupon/Provider/Decorator/Base.php(67): Aimeos\MShop\Coupon\Provider\Decorator\Category->isAvailable()
#10 /vendor/aimeos/aimeos-core/src/MShop/Plugin/Provider/Order/Coupon.php(89): Aimeos\MShop\Coupon\Provider\Decorator\Base->update()
#11 /vendor/aimeos/aimeos-core/src/MShop/Plugin/Provider/Decorator/Log.php(54): Aimeos\MShop\Plugin\Provider\Order\Coupon->update()
#12 /vendor/aimeos/aimeos-core/src/MShop/Plugin/Provider/Decorator/Singleton.php(42): Aimeos\MShop\Plugin\Provider\Decorator\Log->update()
#13 /vendor/aimeos/aimeos-core/src/MW/Observer/Publisher/Traits.php(86): Aimeos\MShop\Plugin\Provider\Decorator\Singleton->update()
#14 /vendor/aimeos/aimeos-core/src/MShop/Order/Item/Base/Base.php(605): Aimeos\MShop\Order\Item\Base\Base->notify()
#15 /vendor/aimeos/aimeos-core/src/MShop/Plugin/Provider/Order/ServicesUpdate.php(116): Aimeos\MShop\Order\Item\Base\Base->setServices()
#16 /vendor/aimeos/aimeos-core/src/MShop/Plugin/Provider/Decorator/Log.php(54): Aimeos\MShop\Plugin\Provider\Order\ServicesUpdate->update()
#17 /vendor/aimeos/aimeos-core/src/MShop/Plugin/Provider/Decorator/Singleton.php(42): Aimeos\MShop\Plugin\Provider\Decorator\Log->update()
#18 /vendor/aimeos/aimeos-core/src/MW/Observer/Publisher/Traits.php(86): Aimeos\MShop\Plugin\Provider\Decorator\Singleton->update()
#19 /vendor/aimeos/aimeos-core/src/MShop/Order/Item/Base/Base.php(261): Aimeos\MShop\Order\Item\Base\Base->notify()
#20 /vendor/aimeos/ai-controller-frontend/src/Controller/Frontend/Basket/Standard.php(448): Aimeos\MShop\Order\Item\Base\Base->addCoupon()
#21 /vendor/aimeos/ai-controller-frontend/src/Controller/Frontend/Basket/Decorator/Base.php(203): Aimeos\Controller\Frontend\Basket\Standard->addCoupon()
#22 /vendor/aimeos/ai-controller-frontend/src/Controller/Frontend/Basket/Decorator/Base.php(203): Aimeos\Controller\Frontend\Basket\Decorator\Base->addCoupon()
#23 /vendor/aimeos/ai-controller-frontend/src/Controller/Frontend/Basket/Decorator/Base.php(203): Aimeos\Controller\Frontend\Basket\Decorator\Base->addCoupon()
#24 /vendor/aimeos/ai-client-html/src/Client/Html/Basket/Standard/Standard.php(186): Aimeos\Controller\Frontend\Basket\Decorator\Base->addCoupon()
#25 /vendor/aimeos/ai-client-html/src/Client/Html/Basket/Standard/Standard.php(113): Aimeos\Client\Html\Basket\Standard\Standard->addCoupon()
#26 /vendor/aimeos/ai-client-html/src/Client/Html/Common/Decorator/Exceptions.php(107): Aimeos\Client\Html\Basket\Standard\Standard->init()
#27 /vendor/aimeos/ai-client-html/src/Client/Html/Common/Decorator/Base.php(153): Aimeos\Client\Html\Common\Decorator\Exceptions->init()
#28 /vendor/aimeos/ai-client-html/src/Client/Html/Common/Decorator/Base.php(153): Aimeos\Client\Html\Common\Decorator\Base->init()
#29 /vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Base/Shop.php(70): Aimeos\Client\Html\Common\Decorator\Base->init()
#30 /vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): Aimeos\Shop\Base\Shop->get()
#31 /vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Controller/BasketController.php(37): Illuminate\Support\Facades\Facade::__callStatic()
#32 /vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Aimeos\Shop\Controller\BasketController->indexAction()
#33 /vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction()
#34 /vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\Routing\ControllerDispatcher->dispatch()
#35 /vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()
#36 /vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\Routing\Route->run()
#37 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Routing\Router->Illuminate\Routing\closure()
#38 /vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#39 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\SubstituteBindings->handle()
#40 /vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#41 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
#42 /vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#43 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#44 /vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#45 /vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
#46 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Session\Middleware\StartSession->handle()
#47 /vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#48 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
#49 /vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#50 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Cookie\Middleware\EncryptCookies->handle()
#51 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#52 /vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\Pipeline\Pipeline->then()
#53 /vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\Routing\Router->runRouteWithinStack()
#54 /vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\Routing\Router->runRoute()
#55 /vendor/laravel/framework/src/Illuminate/Routing/Router.php(729): Illuminate\Routing\Router->dispatchToRoute()
#56 /vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\Routing\Router->dispatch()
#57 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\closure()
#58 /app/Http/Middleware/SetLocale.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#59 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\SetLocale->handle()
#60 /vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#61 /vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#62 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
#63 /vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#64 /vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#65 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
#66 /vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#67 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
#68 /vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#69 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#70 /vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#71 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Http\Middleware\HandleCors->handle()
#72 /vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#73 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Http\Middleware\TrustProxies->handle()
#74 /app/Http/Middleware/TrustHosts.php(24): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#75 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\TrustHosts->handle()
#76 /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#77 /vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\Pipeline\Pipeline->then()
#78 /vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#79 /public/index.php(52): Illuminate\Foundation\Http\Kernel->handle()
#80 main

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

Re: FreeShipping and Category throws SQL error

Post by aimeos » 29 Mar 2023, 07:31

Most likely, the configured category code is empty or doesn't match an existing one.
The issue has been fixed in aimeos/aimeos-core:2022.10.11
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply