Bug #48544
closedExtbase warnings in devLog
100%
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.
Updated by Christian Kuhn about 11 years ago
- Is Regression set to No
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.
Updated by Stefano Cecere about 11 years ago
just checked with new 6.2alpha3 and we have the same warning flood!
Updated by Markus Klein about 11 years ago
@Christian: Why not making them static?
Updated by Christian Kuhn about 11 years ago
- 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.
Updated by Frank Nägler over 10 years ago
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?
Updated by Florian Seirer over 9 years ago
You can use filters in the devlog if you select "All entries".
Updated by Stephan Großberndt over 8 years ago
- 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)
EnvironmentService is a Singleton since https://review.typo3.org/29042
Are there still warnings in devLog?
Updated by Jan Bartels about 8 years ago
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
Updated by Gerrit Code Review about 8 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50033
Updated by Gerrit Code Review about 8 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50033
Updated by Gerrit Code Review about 8 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50033
Updated by Markus Klein about 8 years ago
- 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.
Updated by Michael Stucki almost 8 years ago
Agree that this must not break stable versions.
However, this issue is about the warning in devLog, which should still be changed or removed.
Updated by Kurt Ludikovsky over 7 years ago
- 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.
Updated by Gerrit Code Review over 7 years ago
- Status changed from New to Under Review
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50033
Updated by Markus Klein over 7 years ago
@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.
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52054
Updated by Gerrit Code Review over 7 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50033
Updated by Markus Klein over 7 years ago
- Category set to Extbase
- Assignee set to Markus Klein
- Target version set to next-patchlevel
- Complexity set to easy
I kindly ask all watchers of this ticket to test the solutions and to vote for the patches on Gerrit.
Patch for 8: https://review.typo3.org/50033
Patch for 7: https://review.typo3.org/52054
(Backport to 6.2 is planned)
Updated by Kurt Ludikovsky over 7 years ago
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).
Updated by Markus Klein over 7 years ago
Please use the Reply button on Gerrit to comment on patches. Thanks.
Updated by Gerrit Code Review over 7 years ago
Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52054
Updated by Anonymous over 7 years ago
Commit https://review.typo3.org/#/c/52054/2/typo3/sysext/extbase/Classes/Object/Container/Container.php is looking correct to fix this.
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52319
Updated by Markus Klein over 7 years ago
@Mathias Bruckmoser: Please vote on Gerrit for the patch!!!
https://review.typo3.org/52054
Login with your typo3.org username and password and use the reply button at the top.
Updated by Gerrit Code Review over 7 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50033
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52347
Updated by Markus Klein over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset aeda613ad1d21a1d5a1cd15799e97083b086ac3b.
Updated by Gerrit Code Review over 7 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52348
Updated by Gerrit Code Review over 7 years ago
Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52348
Updated by Markus Klein over 7 years ago
- Status changed from Under Review to Resolved
Applied in changeset 7c45dc50c7bca39d2fc2941940bcfbbdfe3331b4.