Skip to content
Merged
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
24 changes: 23 additions & 1 deletion Classes/Override/CommandMapPostProcessingHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,29 @@ public function processCmdmap_postProcess(
}
$id = (int)$id;
if ($table === 'tt_content' && $command === 'deepltranslate') {
$this->localizeOrCopyToLanguage($id, (int)$value, $command, $dataHandler);
// b13/container reworked their DataHandler hook implementation and splitted the method into
// dedicated methods, which needs to be handled here to allow multiple b13/container versions.
// See:
// - https://github.com/b13/container/issues/609
// - https://github.com/b13/container/pull/617
if (method_exists($this, 'localizeOrCopyToLanguage')) {
$this->localizeOrCopyToLanguage($id, (int)$value, $command, $dataHandler);
} elseif (method_exists($this, 'localizeChildren')) {
$this->localizeChildren($id, (int)$value, $command, $dataHandler);
} else {
throw new \RuntimeException(
sprintf(
implode('', [
'Extension "%s" changed their internal DataHandler hook implementation "%s" again. Please ',
'open an issue on "%s" and report the issue so it can be adopted.',
]),
'b13/container',
\B13\Container\Hooks\Datahandler\CommandMapPostProcessingHook::class,
'https://github.com/web-vision/deepltranslate-core/issues',
),
1748860059,
);
}
} else {
parent::processCmdmap_postProcess($command, $table, $id, $value, $dataHandler, $pasteUpdate, $pasteDatamap);
}
Expand Down