Bug #48544
closed
Extbase warnings in devLog
Added by Stefano Cecere over 11 years ago.
Updated about 6 years ago.
Description
if you install devlog (patching it because it hangs 6.1) the devlog gets filled with these warnings wherever you open an extbase module (like the new Backedn Users or EM).. making it useless
Called from Page User Extra data
26-05-13 16:56:47 extbase The singleton "TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder" needs a prototype in "injectEnvironmentService". This is often a bad code smell; often you rather want to inject a singleton. Container.php, line 243 stefano.cecere
26-05-13 16:56:47 extbase The singleton "TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder" needs a prototype in "injectEnvironmentService". This is often a bad code smell; often you rather want to inject a singleton. Container.php, line 243 stefano.cecere
26-05-13 16:56:47 extbase The singleton "TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend" needs a prototype in "injectEnvironmentService". This is often a bad code smell; often you rather want to inject a singleton. Container.php, line 243 stefano.cecere
26-05-13 16:56:47 extbase The singleton "TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager" needs a prototype in "injectEnvironmentService". This is often a bad code smell; often you rather want to inject a singleton. Container.php, line 243 stefano.cecere
26-05-13 16:56:47 extbase The singleton "TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager" needs a prototype in "injectQueryGenerator". This is often a bad code smell; often you rather want to inject a singleton. Container.php, line 243 stefano.cecere
26-05-13 16:56:47 extbase The singleton "TYPO3\CMS\Extbase\Configuration\ConfigurationManager" needs a prototype in "injectEnvironmentService". This is often a bad code smell; often you rather want to inject a singleton.
- Target version deleted (
2338)
This issue is another proof that singletons are an anti-pattern. We have to solve this issues somehow, but I currently have no good idea on how to do that. There are 4 options:
- Implement SingletonInterface in injected dependencies like EnvironmentService
- Do not use dependency injection in the singleton class but get the instance with objectManager->get()
- Remove SingletonInterface from RequestBuilder and Widget class and so on (if possible)
- Drop the log message
We should discuss on how to systematically solve this issue.
just checked with new 6.2alpha3 and we have the same warning flood!
@Christian: Why not making them static?
- class EnvironmentService should implement SingletonInterface
- BackendConfigurationManager should either not use QueryGenerator at all, or should not inject but objectManager->get() the instance at the point where it is used.
last update was 9 months ago, and nothing happens? The devlog grows up only with this messages. is it possible to filter this messages out?
You can use filters in the devlog if you select "All entries".
- Subject changed from devlog fileld with extbase warnings! to Extbase warnings in devLog
- Status changed from New to Needs Feedback
- TYPO3 Version changed from 6.1 to 6.2
- PHP Version deleted (
5.3)
With Typo3 6.2.27 I still get messages like The singleton "TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager" needs a prototype in "queryGenerator". This is often a bad code smell; often you rather want to inject a singleton. Container.php, Zeile 260
- Status changed from Needs Feedback to Under Review
- Status changed from Under Review to New
This is a risky patch, which could break extension extending the class in question.
Therefore this may not be fixed for 7.6 and below.
A fix for master could be done, but is not on the timeline for now.
Agree that this must not break stable versions.
However, this issue is about the warning in devLog, which should still be changed or removed.
- TYPO3 Version changed from 6.2 to 7
- PHP Version set to 5.6
Is there any solution in sight for 7.6?
7.6 is considered a LTS release and shall still be maintained till end of 2020.
In addition many of the extensions are currently ported and available for 7.6 (apart from 6.2), which make T3 valuable over other CMS.
If this support and stability breaks, and a there are a lot of issues like this, which is now unsresolved for nearly four yours, the support for T3 will drop.
- Status changed from New to Under Review
@Kurt: See new patch version. I gave it another try, lets see if we manage to "solve" it this time.
Please also read the comment history of the review for details.
- Category set to Extbase
- Assignee set to Markus Klein
- Target version set to next-patchlevel
- Complexity set to easy
Please check the base for the modifications.
The patch sets seems to have a different base for 7.6 as the base does not match my source, and also the patched file crashed my 7.6 T3-BE (with 7.6.15 and 7.6.16).
Please use the Reply button on Gerrit to comment on patches. Thanks.
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Under Review
- Status changed from Under Review to Resolved
- Status changed from Resolved to Closed
Also available in: Atom
PDF