Issue Bug Closed

#103858typo3 list command does not work propperly for other formats then txt

Lina Wolf 05/19/24, 10:11 updated 09/21/24, 18:50

Description

ddev exec bin/typo3 list

and

ddev exec bin/typo3 list —format=json > commands.json

For example the first contains the site namespace while it is missing in the second.
I verified this to happen in the current main-Core and in installations of TYPO3 13.1 and 12.4.

I suspect this is to the fact that the ListCommand registers a custom TextDescriptor
for format txt but not the other supported formats.

We – the documentation team – want to use the json format to auto-generate documentation:

https://github.com/TYPO3-Documentation/t3docs-console-command so this bug is now really hindering that…

Reviews 1

History 46

  1. Lina Wolf changed subject typo3 list command does not work propperly for other formats then html typo3 list command does not work propperly for other formats then txt <span data-processor="relativetime" data-value="2024-05-19T10:18:10+00:00" > 05/19/24, 10:18 </span>

  2. Garvin Hicking commented <span data-processor="relativetime" data-value="2024-05-27T06:47:04+00:00" > 05/27/24, 06:47 </span>

    I’ll try to get at least a PoC for this as a core patch. Problem is the main TextDescriptor is heavily patched from vanilla symfony, and all that had to be duplicated to the jsonDescriptor (and probably xml too). Might be harder than it sounds due to all that custom processing.

  3. Gerrit Code Review pushed patch set 1 for main to change 86247 status Accepted Under Review <span data-processor="relativetime" data-value="2024-09-20T14:49:33+00:00" > 09/20/24, 14:49 </span>

  4. Garvin Hicking commented and changed status Under Review Closed <span data-processor="relativetime" data-value="2024-09-21T18:50:25+00:00" > 09/21/24, 18:50 </span>

    The problem here is that the Symfony Descriptor API does not integrate well with TYPO3’s custom commandregistry. There’s currently no way to inject a different command/namespace list and to re-use the JsonDescriptor of Symfony, leading to a lot of code duplication.

    A proper way would be to patch the Symfony JsonDescriptor and create a different API that allows injecting other commands, but that would take a lot of effort.

    For now, the “sane” way to get this to work is using a custom extension providing a custom CLI command that uses the fully bootstrapped TYPO3 command list, which uses the “normal” Symfony command registration, and not the TYPO3 custom one. A very basic extension is this:

    https://packagist.org/packages/garvinhicking/clinspector-gadget

    This has been integrated as a PR into the docs repos:

    https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/4772
    https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/4771

    and should work well. The upside is that it will also work for TYPO3 v11-13 since it’s a very, very basic CLI command.

    I’m closing this issue for now, if you think that is a mistake, please let me know.