Recent Topics

Category related language error on save-order API hit



  • Hello Team,

    I am facing a very strange issue, I am unable to rectify this. Pls. help!
    I am getting this while using save-order API.

    Bagisto Version: 1.2.x

    Recent actions performed in last few days:

    1. Added INR currency and delete all other currencies
    2. Deleted all locales except en using admin (I reverted this by adding deleted entries in locales table using sql, did not work)

    Rectification tried:
    I checked Root category in the category table and found that local=en and local_id=NULL, so I changed the local_id to 1 (en) but still it did not work.

    Error Originating code:

    c24e91b3-bec9-4795-a7ea-56917c6c6cdf-image.png

    ERROR:

    TypeError: Argument 1 passed to Webkul\Core\Eloquent\TranslatableModel::getTranslationByLocaleKey() must be of the type string, null given, called in /home/shop/public_html/backend/vendor/astrotomic/laravel-translatable/src/Translatable/Translatable.php on line 196 in file /home/shop/public_html/backend/vendor/astrotomic/laravel-translatable/src/Translatable/Translatable.php on line 425
    Stack trace:
      1. TypeError->() /home/shop/public_html/backend/vendor/astrotomic/laravel-translatable/src/Translatable/Translatable.php:425
      2. Webkul\Core\Eloquent\TranslatableModel->getTranslationByLocaleKey() /home/shop/public_html/backend/vendor/astrotomic/laravel-translatable/src/Translatable/Translatable.php:196
      3. Webkul\Core\Eloquent\TranslatableModel->getTranslation() /home/shop/public_html/backend/vendor/astrotomic/laravel-translatable/src/Translatable/Translatable.php:145
      4. Webkul\Core\Eloquent\TranslatableModel->getAttribute() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1633
      5. Illuminate\Database\Eloquent\Model->__get() /home/shop/public_html/backend/packages/Webkul/Core/src/Core.php:783
      6. Webkul\Core\Core->country_name() /home/shop/public_html/backend/packages/Webkul/API/Http/Resources/Sales/OrderAddress.php:24
      7. Webkul\API\Http\Resources\Sales\OrderAddress->toArray() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php:95
      8. Illuminate\Http\Resources\Json\JsonResource->resolve() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php:231
      9. Illuminate\Http\Resources\Json\JsonResource->jsonSerialize() [internal]:0
     10. json_encode() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php:71
     11. Illuminate\Http\JsonResponse->setData() /home/shop/public_html/backend/vendor/symfony/http-foundation/JsonResponse.php:50
     12. Symfony\Component\HttpFoundation\JsonResponse->__construct() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php:31
     13. Illuminate\Http\JsonResponse->__construct() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php:99
     14. Illuminate\Routing\ResponseFactory->json() /home/shop/public_html/backend/packages/Webkul/API/Http/Controllers/Shop/CheckoutController.php:214
     15. Webkul\API\Http\Controllers\Shop\CheckoutController->saveOrder() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54
     16. call_user_func_array() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54
     17. Illuminate\Routing\Controller->callAction() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45
     18. Illuminate\Routing\ControllerDispatcher->dispatch() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/Route.php:239
     19. Illuminate\Routing\Route->runController() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/Route.php:196
     20. Illuminate\Routing\Route->run() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php:685
     21. Illuminate\Routing\Router->Illuminate\Routing\{closure}() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:128
     22. Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() /home/shop/public_html/backend/packages/Webkul/Shop/src/Http/Middleware/Currency.php:46
     23. Webkul\Shop\Http\Middleware\Currency->handle() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
     24. Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() /home/shop/public_html/backend/packages/Webkul/Shop/src/Http/Middleware/Theme.php:31
     25. Webkul\Shop\Http\Middleware\Theme->handle() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
     26. Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() /home/shop/public_html/backend/packages/Webkul/Shop/src/Http/Middleware/Locale.php:50
     27. Webkul\Shop\Http\Middleware\Locale->handle() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
     28. Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103
     29. Illuminate\Pipeline\Pipeline->then() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php:687
     30. Illuminate\Routing\Router->runRouteWithinStack() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php:662
     31. Illuminate\Routing\Router->runRoute() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php:628
     32. Illuminate\Routing\Router->dispatchToRoute() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php:617
     33. Illuminate\Routing\Router->dispatch() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:165
     34. Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:128
     35. Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() /home/shop/public_html/backend/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php:65
     36. Barryvdh\Debugbar\Middleware\InjectDebugbar->handle() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
     37. Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:116
     38. Illuminate\Session\Middleware\StartSession->handleStatefulRequest() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:62
     39. Illuminate\Session\Middleware\StartSession->handle() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
     40. Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37
     41. Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
     42. Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:66
     43. Illuminate\Cookie\Middleware\EncryptCookies->handle() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
     44. Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:63
     45. Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
     46. Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103
     47. Illuminate\Pipeline\Pipeline->then() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:140
     48. Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() /home/shop/public_html/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:109
     49. Illuminate\Foundation\Http\Kernel->handle() /home/shop/public_html/backend/public/index.php:79
    


  • Have you done any changes from the DB end as well because its look like something broken in root category.



  • No changes were done in DB.

    Only thing was changed is mentioned under Rectification tried, that too after facing the issue.



  • Did you check the category_translation table?


Log in to reply