Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/ADF-1827/sync-translations-on-authoring #490

Merged
merged 4 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest ]
php-version: [ '7.4', '8.0', '8.1' ]
php-version: [ '8.0', '8.1' ]
include:
- php-version: '8.1'
coverage: true
Expand Down
7 changes: 7 additions & 0 deletions actions/class.Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use oat\generis\model\resource\exception\ResourceDeletionException;
use oat\tao\model\resources\Exception\PartialClassDeletionException;
use oat\tao\model\Lists\Business\Validation\DependsOnPropertyValidator;
use oat\tao\model\Translation\Service\TranslationSyncService;

/**
* Tests Controller provide actions performed from url resolution
Expand Down Expand Up @@ -251,6 +252,7 @@ public function authoring()
);
}
if ($this->getRequestParameter('originResourceUri') !== null) {
$this->getTranslationSyncService()->syncById($this->getRequestParameter('originResourceUri'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shaveko the FE already calls and endpoint translation/sync to call the syncByRequest. I am not sure also asking the BE to do the same is a good idea 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check comment to the ticket

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now yes, if we remove the FE part of the code, it makes sense to do it on the BE side. When I checked the PRs, there was only the BE part introduced, so the call would be redundant and this sync process is quite expensive.

$authoringUrl = sprintf(
'%s&originResourceUri=%s',
$authoringUrl,
Expand Down Expand Up @@ -331,4 +333,9 @@ private function getResourceDeleter(): ResourceDeleterInterface
{
return $this->getPsrContainer()->get(ResourceDeleter::class);
}

private function getTranslationSyncService(): TranslationSyncService
{
return $this->getPsrContainer()->get(TranslationSyncService::class);
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"require": {
"oat-sa/oatbox-extension-installer": "~1.1||dev-master",
"oat-sa/generis": ">=15.39.0",
"oat-sa/tao-core": ">=54.25.0",
"oat-sa/tao-core": ">=54.27.0",
"oat-sa/extension-tao-backoffice": ">=6.0.0",
"oat-sa/extension-tao-item": ">=12.5.0"
},
Expand Down
Loading