Project

General

Profile

Actions

Bug #48544

closed

Extbase warnings in devLog

Added by Stefano Cecere over 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Extbase
Target version:
Start date:
2013-05-26
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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.

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #57518: Make Extbase EnvironmentService a SingletonClosed2014-04-01

Actions
Actions #1

Updated by Ernesto Baschny over 11 years ago

  • Target version deleted (2338)
Actions #2

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.

Actions #3

Updated by Stefano Cecere about 11 years ago

just checked with new 6.2alpha3 and we have the same warning flood!

Actions #4

Updated by Markus Klein about 11 years ago

@Christian: Why not making them static?

Actions #5

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.
Actions #6

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?

Actions #7

Updated by Florian Seirer over 9 years ago

You can use filters in the devlog if you select "All entries".

Actions #8

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?

Actions #9

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

Actions #10

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

Actions #11

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

Actions #12

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

Actions #13

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.

Actions #14

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.

Actions #15

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.

Actions #16

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

Actions #17

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.

Actions #18

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

Actions #19

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

Actions #20

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)

Actions #21

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).

Actions #22

Updated by Markus Klein over 7 years ago

Please use the Reply button on Gerrit to comment on patches. Thanks.

Actions #23

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

Actions #25

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

Actions #26

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.

Actions #27

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

Actions #28

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

Actions #29

Updated by Markus Klein over 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #30

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

Actions #31

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

Actions #32

Updated by Markus Klein over 7 years ago

  • Status changed from Under Review to Resolved
Actions #33

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF