Bug #10595

ObjectManager should not allow injection of prototypes

Added by Bastian Waidelich almost 5 years ago. Updated almost 5 years ago.

Status:Rejected Start date:2010-11-02
Priority:Should have Due date:
Assigned To:Robert Lemke % Done:

0%

Category:Object
Target version:TYPO3 Flow Base Distribution - 1.0 beta 1
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

Currently it is possible to inject prototypes like:

public function injectTagBuilder(\F3\Fluid\Core\ViewHelper\TagBuilder $tagBuilder) {
    $this->tagBuilder = $tagBuilder;
}

This leads to some unexpected side effects especially when used in singletons.
IMO we should prevent this and throw a meaningful exception stating that you need to inject the object manager in order to create prototype instances.


Related issues

related to TYPO3.Flow - Bug #25448: Use of undefined constant 'X' during prototype injection Closed 2011-03-30
related to TYPO3.Flow - Bug #25908: ProxyClassBuilder produces invalid code for prototype arg... Resolved 2011-04-12

History

#1 Updated by Karsten Dambekalns over 4 years ago

  • Status changed from New to Accepted
  • Assigned To set to Robert Lemke
  • Target version set to 1.0 beta 1

As discussed a few times in the past weeks, prototype injection should be possible, but it needs to

  • have everything needed to costruct configured
  • or have a factory configured

Currently it is possible to have prototypes injected.

@Robert: if this is done, please resolve/close, if not, give feedback.

#2 Updated by Sebastian Kurfuerst almost 5 years ago

  • Status changed from Accepted to Rejected

Also available in: Atom PDF