Issue Bug Closed

#105509Page title provider with absolute FQN causes container error

Lina Wolf 10/29/24, 10:04 updated 03/27/25, 05:54

Description

Until TYPO3 v 12.4 it was possible to define a page title provider like this in TypoScript:

    config.pageTitleProviders {
        beratungsstelle {
            provider = \MyVendor\MyExtension\PageTitle\PageTitleProvider
            before = record
            after = altPageTitle
        }
    }

In 13.4 an error is thrown:

You have requested a non-existent service "\MyVendor\MyExtension\PageTitle\PageTitleProvider". 
Did you mean this: "MyVendor\MyExtension\PageTitle\PageTitleProvider"?

I would suggest that we trim for a backslash at the start in

/var/www/html/vendor/typo3/cms-core/Classes/PageTitle/PageTitleProviderManager.php line 59

And possibly test the existence of the Service before using it so that we can give better error messages.

Removing the slash at the start of the3 FQNC solves the ptoblem

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 4

  1. Georg Ringer commented <span data-processor="relativetime" data-value="2024-10-30T17:33:10+00:00" > 10/30/24, 17:33 </span>

    we never trim the \ but fail with class not found usually.

  2. Benni Mack commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2025-03-06T18:45:19+00:00" > 03/06/25, 18:45 </span>

    Hey Lina,

    cannot reproduce this in TYPO3 v12. I receive the same exception in v12…

    From the code:
    ——————-

    // Never instantiate with a beginning backslash, otherwise things like singletons won’t work.
    if ($className0 === ‘\\’) {
    throw new \InvalidArgumentException(
    ‘$className “’ . $className . ‘” must not start with a backslash.’,
    1420281366
    );
    }
    ——————-

    Can you tell me how to reproduce this?

  3. Lina Wolf commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2025-03-27T05:54:03+00:00" > 03/27/25, 05:54 </span>

    Cannot reproduce