Issue Task Rejected

#91237Symfony DI (dependency injection) for ClassAliasMap(s)

Christian Hackl 04/29/20, 17:30 updated 10/01/24, 10:21

Description

Symfony DI (dependency injection) for ClassAliasMap(s)

For example dependency injection for “\TYPO3\CMS\Frontend\Page\PageRepository” via constructor didn’t work.

// Classes/Controller/MyController.php

/**
 * pagesRepository
 *
 * @var \TYPO3\CMS\Frontend\Page\PageRepository
 */
protected $pageRepository = null;

public function __construct(\TYPO3\CMS\Frontend\Page\PageRepository $pageRepository) {
    $this->pageRepository = $pageRepository;
}

Reviews 1

History 6

  1. Benjamin Franzke changed assigned to Benjamin Franzke 04/29/20, 17:32

  2. Benjamin Franzke commented 04/29/20, 17:33

    For reference, initial discussion was here: https://typo3.slack.com/archives/C0CRS7RFH/p1588169890380700

  3. Benni Mack changed target version 04/29/20, 17:45

  4. Garvin Hicking changed category 07/31/24, 08:54

  5. Garvin Hicking commented and changed status New Needs Feedback 09/11/24, 09:59

    Is this something that still needs addressing, or can we close it?

  6. Benjamin Franzke commented and changed status Needs Feedback Rejected 10/01/24, 10:21

    There is no “proper” way to solve this generally, sorry.
    We need to add define (deprecated) service aliases when moving public API in new cases like these.

    An example for that is the following change:
    > 75994: [BUGFIX] Add alias for moved RecordLinkHandler service | https://review.typo3.org/c/Packages/TYPO3.CMS/+/75994

    That means this is sth. we need to generally take care of in reviews.