Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

v8.7.2 - Failure when trying to update translations from the parent collection interface #1926

Closed
yarick2000 opened this issue Jun 9, 2020 · 1 comment · Fixed by #1987
Closed
Labels
bug Something isn't working

Comments

@yarick2000
Copy link
Contributor

yarick2000 commented Jun 9, 2020

Hello, after updating Directus I've figured out that it's impossible to update translations data anymore from the interface of parent collection - the following error received:
image
However when translation data updated directly from the translations collection the updated passing without any problem.
The error log giving the following stack trace:
#0 /mnt/c/Projects/Directus/directus-api/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(361): Directus\Database\TableGateway\BaseTableGateway->executeUpdate
#1 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Database/TableGateway/BaseTableGateway.php(434): Zend\Db\TableGateway\AbstractTableGateway->updateWith
#2 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Database/TableGateway/BaseTableGateway.php(363): Directus\Database\TableGateway\BaseTableGateway->updateRecordByArray
#3 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Database/TableGateway/RelationalTableGateway.php(199): Directus\Database\TableGateway\BaseTableGateway->addOrUpdateRecordByArray
#4 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Database/TableGateway/RelationalTableGateway.php(706): Directus\Database\TableGateway\RelationalTableGateway->manageRecordUpdate
#5 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Database/TableGateway/RelationalTableGateway.php(522): Directus\Database\TableGateway\RelationalTableGateway->addOrUpdateToManyRelationships
#6 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Services/ItemsService.php(364): Directus\Database\TableGateway\RelationalTableGateway->updateRecord
#7 /mnt/c/Projects/Directus/directus-api/src/endpoints/Items.php(121): Directus\Services\ItemsService->update
#8 [internal function]: Directus\Api\Routes\Items->update
#9 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func
#10 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke
#11 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Application/Http/Middleware/AbstractRateLimitMiddleware.php(34): Slim\Route->__invoke
#12 [internal function]: Directus\Application\Http\Middleware\AbstractRateLimitMiddleware->__invoke
#13 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array
#14 [internal function]: Slim\DeferredCallable->__invoke
#15 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func
#16 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Application/Http/Middleware/AuthenticationMiddleware.php(124): Slim\Route->Slim{closure}
#17 [internal function]: Directus\Application\Http\Middleware\AuthenticationMiddleware->__invoke
#18 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array
#19 [internal function]: Slim\DeferredCallable->__invoke
#20 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func
#21 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Application/Http/Middleware/TableGatewayMiddleware.php(25): Slim\Route->Slim{closure}
#22 [internal function]: Directus\Application\Http\Middleware\TableGatewayMiddleware->__invoke
#23 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array
#24 [internal function]: Slim\DeferredCallable->__invoke
#25 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func
#26 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Application/Http/Middleware/DatabaseMigrationMiddleware.php(15): Slim\Route->Slim{closure}
#27 [internal function]: Directus\Application\Http\Middleware\DatabaseMigrationMiddleware->__invoke
#28 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array
#29 [internal function]: Slim\DeferredCallable->__invoke
#30 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func
#31 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim{closure}
#32 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack
#33 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/App.php(503): Slim\Route->run
#34 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Application/Http/Middleware/AbstractRateLimitMiddleware.php(34): Slim\App->__invoke
#35 [internal function]: Directus\Application\Http\Middleware\AbstractRateLimitMiddleware->__invoke
#36 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array
#37 [internal function]: Slim\DeferredCallable->__invoke
#38 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func
#39 /mnt/c/Projects/Directus/directus-api/vendor/directus/proxy-detection/src/ProxyDetectionMiddleware.php(30): Slim\App->Slim{closure}
#40 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Application/Http/Middleware/ProxyMiddleware.php(18): RKA\Middleware\ProxyDetectionMiddleware->__invoke
#41 [internal function]: Directus\Application\Http\Middleware\ProxyMiddleware->__invoke
#42 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array
#43 [internal function]: Slim\DeferredCallable->__invoke
#44 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func
#45 /mnt/c/Projects/Directus/directus-api/vendor/akrabat/ip-address-middleware/src/IpAddress.php(113): Slim\App->Slim{closure}
#46 [internal function]: RKA\Middleware\IpAddress->__invoke
#47 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array
#48 [internal function]: Slim\DeferredCallable->__invoke
#49 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func
#50 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Application/Http/Middleware/CorsMiddleware.php(71): Slim\App->Slim{closure}
#51 [internal function]: Directus\Application\Http\Middleware\CorsMiddleware->__invoke
#52 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array
#53 [internal function]: Slim\DeferredCallable->__invoke
#54 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func
#55 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Application/Http/Middleware/ResponseCacheMiddleware.php(63): Slim\App->Slim{closure}
#56 [internal function]: Directus\Application\Http\Middleware\ResponseCacheMiddleware->__invoke
#57 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array
#58 [internal function]: Slim\DeferredCallable->__invoke
#59 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func
#60 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim{closure}
#61 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack
#62 /mnt/c/Projects/Directus/directus-api/vendor/slim/slim/Slim/App.php(297): Slim\App->process
#63 /mnt/c/Projects/Directus/directus-api/src/core/Directus/Application/Application.php(161): Slim\App->run
#64 /mnt/c/Projects/Directus/directus-api/public/index.php(5): Directus\Application\Application->run [] []

The issue happens on local machine with the API server under:
Windows 10 WSL with Ubuntu 16.04
Mysql 5.7.27
NGINX 1.10.3
Php 7.3
and also in another environment
Ubuntu 18.04.2 LTS
MySQL 8.0.16
NGINX 1.14.0
PHP 7.3

P.S. This error can be reproduced on demo site : https://demo.directus.io/

@benhaynes benhaynes added the bug Something isn't working label Jun 10, 2020
@darioseidl
Copy link

Same bug reported here: https://github.com/directus/app/issues/2834

rijkvanzanten pushed a commit that referenced this issue Sep 25, 2020
* Adds UTC version of created_on field to the payload

This code change fixing suppose to fix the issued described in the following tickets:
#1926
https://github.com/directus/app/issues/2834
The created_on field is part of the update request for translations data, but its not converted to UTC when update is processing. It's causing TableGateway to fail when updateWith method is called

* Update CoreServicesProvider.php

* Update CoreServicesProvider.php

Added additional validation for existence of "created_on" field in payload and only then make an update.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants