Issue Bug Closed

#104737Check for Broken Extensions shows "Loading ext_tables.php of extension "xyz" failed"

Markus Ehrlich 08/26/24, 11:38 updated 08/12/25, 14:37

Description

Calling GeneralUtility::makeInstance in the file `ext_tables.php` of a custom extension results in the installation tool displaying, that the file `ext_tables.php` cannot be loaded.

Nevertheless, the extension appears to be working normally.

Own DokTypes should be registered in `ext_tables.php` with the following call:

$dokTypeRegistry = GeneralUtility::makeInstance(PageDoktypeRegistry::class);

I couldn’t see the behavior in v13.1 yet. I’m currently running v13.2.1.

Reviews 5

Files 1

History 1720

  1. Markus Ehrlich changed attached Bildschirmfoto 2024-08-26 um 13.38.43.png <span data-processor="relativetime" data-value="2024-08-26T11:39:11+00:00" > 08/26/24, 11:39 </span>

  2. Benjamin Franzke commented and changed assigned to Oliver Bartsch <span data-processor="relativetime" data-value="2024-08-29T11:46:34+00:00" > 08/29/24, 11:46 </span>

    quick investigation:

    This is likely caused by https://review.typo3.org/c/Packages/TYPO3.CMS/+/84945
    Since that change PageDoktypeRegistry became a service that requires DI.

    I would have said, that the ext_tables.php check needs to use LateBootService and boot a container, but it should already do that in typo3/sysext/install/Classes/Service/LoadTcaService.php – so I don’t know the exact reason right now.

    Needs to be checked manually…

    CC @obartsch

  3. Benjamin Franzke commented and changed status New Needs Feedback removed the assignee <span data-processor="relativetime" data-value="2024-08-29T11:56:13+00:00" > 08/29/24, 11:56 </span>

    Please share the exact contents of the ext_tables.php files.

    Could not verify with v13.2.1 having a ext_tables.php with:

    <?php
    use TYPO3\CMS\Core\DataHandling\PageDoktypeRegistry;
    use TYPO3\CMS\Core\Utility\GeneralUtility;
    $dokTypeRegistry = GeneralUtility::makeInstance(PageDoktypeRegistry::class);
  4. Markus Ehrlich commented and changed assigned to Benjamin Franzke <span data-processor="relativetime" data-value="2024-09-02T09:48:20+00:00" > 09/02/24, 09:48 </span>

    Here is content of my ext_tables.php file:

    <?php
    declare(strict_types=1);
    
    use TYPO3\CMS\Core\DataHandling\PageDoktypeRegistry;
    use TYPO3\CMS\Core\Utility\GeneralUtility;
    
    defined('TYPO3') or die();
    
    (function () {
        /**
         * Register doktype 110 for article pages
         */
        $articlePageDoktype = 110;
    
        $dokTypeRegistry = GeneralUtility::makeInstance(PageDoktypeRegistry::class);
        $dokTypeRegistry->add(
            $articlePageDoktype,
            [
                'type' => 'web',
                'allowedTables' => '*',
            ],
        );
    })();
  5. Garvin Hicking commented <span data-processor="relativetime" data-value="2024-09-02T14:20:25+00:00" > 09/02/24, 14:20 </span>

    Hi Markus,

    hm I used your exact file and it works in my environment. Are you able to test this with a GIT “main” version?

  6. Georg Ringer commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2025-01-26T21:46:57+00:00" > 01/26/25, 21:46 </span>

    closing issue because of lack of feedback. feel free to ask me on e.g. slack to reopen if still valid! hope you understand

  7. Benoit Chenu commented <span data-processor="relativetime" data-value="2025-05-09T16:25:03+00:00" > 05/09/25, 16:25 </span>

    I’ve got exactly the same error on the 13.4.9. The error occurs when PageDoktypeRegistry is simply instanciated:

    <?php
    
    declare(strict_types=1);
    
    use TYPO3\CMS\Core\DataHandling\PageDoktypeRegistry;
    use TYPO3\CMS\Core\Utility\GeneralUtility;
    
    defined('TYPO3') || die();
    
    (function () {
        GeneralUtility::makeInstance(PageDoktypeRegistry::class);
    })();

    I used xdebug to find the original problem and an exception effectively occurs:

    message = "The field "layout" is missing the required "type" in Content Block "site/images"."
    file = "/var/www/html/vendor/friendsoftypo3/content-blocks/Classes/Definition/Factory/ContentBlockCompiler.php"
    line = 967

    The layout field is added by content-blocks extension if we add this in the content element configuration:

    basics:
      - TYPO3/Appearance

    But the “basic” configuration defined by content-blocks extension is too light:

    # To be used within ContentElements
    identifier: TYPO3/Appearance
    fields:
      -
        identifier: appearance_tab
        type: Tab
        label: LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance
      -
        identifier: frames_palette
        type: Palette
        label: LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.frames
        fields:
          -
            identifier: layout
            useExistingField: true
          -
            identifier: frame_class
            useExistingField: true
          -
            identifier: space_before_class
            useExistingField: true
          -
            identifier: space_after_class
            useExistingField: true

    So this is a friendsoftypo3/content-blocks bug, I will report and fix this.

    By the way, finding this kind of error is a little bit touchy. It should to find to at least display the exception in backend interface. I also will open a issue for that.

  8. Benoit Chenu commented <span data-processor="relativetime" data-value="2025-05-09T16:29:16+00:00" > 05/09/25, 16:29 </span>

    Sorry, my last sentence means nothing :)

    At least there should be a way to display the exception in the backend interface.

  9. Nikita Hovratov commented <span data-processor="relativetime" data-value="2025-05-09T18:01:52+00:00" > 05/09/25, 18:01 </span>

    This issue currently occurs with the Content Blocks extension, because it extends PageDokTypeRegistry with a Service Provider. As Content Blocks relies on loaded TCA, the ext_tables.php check fails. The check apparently doesn’t load any TCA. A comment in PageDokTypeRegistry suggests it can only be fully used with loaded TCA: You can fully use this once TCA is properly loaded (e.g. in ext_tables.php)..

    Not sure how much sense it makes to test ext_tables.php in isolation anyway if it relies on global state.

  10. Nikita Hovratov commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-05-16T07:15:08+00:00" > 05/16/25, 07:15 </span>

    Applied in changeset commit:f4bade0701a26d5cc80a527a816d48b69fe927c5.