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

[BUG] Exception during deepl:glossary:list #367

Closed
vertexvaar opened this issue Oct 16, 2024 · 3 comments
Closed

[BUG] Exception during deepl:glossary:list #367

vertexvaar opened this issue Oct 16, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@vertexvaar
Copy link

Describe the bug

$ vendor/bin/typo3 deepl:glossary:list
============
Read more here: https://www.deepl.com/docs-api/managing-glossaries/listing-glossaries/
============

Uncaught TYPO3 Exception Symfony\Component\Console\Helper\Table::addRow(): Argument #1 ($row) must be of type Symfony\Component\Console\Helper\TableSeparator|array, DeepL\GlossaryInfo given, called in /app/app/vendor/symfony/console/Helper/Table.php on line 210
thrown in file /app/app/vendor/symfony/console/Helper/Table.php
in line 219

To Reproduce

Exception with Stacktrace

TypeError: Symfony\Component\Console\Helper\Table::addRow(): Argument #1 ($row) must be of type Symfony\Component\Console\Helper\TableSeparator|array, DeepL\GlossaryInfo given, called in /app/app/vendor/symfony/console/Helper/Table.php on line 210 and defined in /app/app/vendor/symfony/console/Helper/Table.php:219
Stack trace:
#0 /app/app/vendor/symfony/console/Helper/Table.php(210): Symfony\Component\Console\Helper\Table->addRow(Object(DeepL\GlossaryInfo))
#1 /app/app/vendor/symfony/console/Helper/Table.php(201): Symfony\Component\Console\Helper\Table->addRows(Array)
#2 /app/app/vendor/web-vision/wv_deepltranslate/Classes/Command/GlossaryListCommand.php(71): Symfony\Component\Console\Helper\Table->setRows(Array)
#3 /app/app/vendor/web-vision/wv_deepltranslate/Classes/Command/GlossaryListCommand.php(36): WebVision\WvDeepltranslate\Command\GlossaryListCommand->listAllGloassaryEntries(Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /app/app/vendor/symfony/console/Command/Command.php(326): WebVision\WvDeepltranslate\Command\GlossaryListCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /app/app/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /app/app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(WebVision\WvDeepltranslate\Command\GlossaryListCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /app/app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /app/app/vendor/typo3/cms-core/Classes/Console/CommandApplication.php(112): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /app/app/vendor/typo3/cms-cli/typo3(23): TYPO3\CMS\Core\Console\CommandApplication->run()
#10 /app/app/vendor/typo3/cms-cli/typo3(24): {closure}()
#11 /app/app/vendor/bin/typo3(119): include('/app/app/vendor...')
#12 {main}

TYPO3 Setup

Composer install in docker

typo3/cms-core                            12.4.21
web-vision/wv_deepltranslate              4.3.1
symfony/console                           6.4.12
deeplcom/deepl-php                        1.9.0
@vertexvaar vertexvaar added the bug Something isn't working label Oct 16, 2024
@vertexvaar vertexvaar changed the title [BUG] Can not sync glossaries on CLI [BUG] Exception during deepl:glossary:list Oct 16, 2024
@vertexvaar
Copy link
Author

quick fix with composer patches

Index: Classes/Command/GlossaryListCommand.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Classes/Command/GlossaryListCommand.php b/Classes/Command/GlossaryListCommand.php
--- a/Classes/Command/GlossaryListCommand.php	
+++ b/Classes/Command/GlossaryListCommand.php	(date 1729065678558)
@@ -62,7 +62,9 @@
         $rows = [];
 
         foreach ($glossaries as $eachGlossary) {
-            $rows[] = $eachGlossary;
+            $row = (array) $eachGlossary;
+            $row['creationTime'] = $row['creationTime']->format('Y-m-d H:i:s');
+            $rows[] = $row;
         }
 
         $table = new Table($output);

@calien666 calien666 self-assigned this Nov 20, 2024
@calien666
Copy link
Member

Hey @vertexvaar
Could you please check, if the error still appears in latest main branch? Quite after the last release we changed this part and updated the listing of the glossaries, which will get into next release. This means, your patch is valid for 4.3.1, but not for latest main.

I'm sorry for this late feedback about this. I will be appreciated about a feedback from you.

@calien666
Copy link
Member

As there was no answer since three months, we see this issue as resolved. If you think, this isn't correct, feel free to comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants