44694[!!!][TASK] Clean up ObjectManager injection of CommandController
Commit message
Review
-
Code review CR +2
- Andreas Wolf +2
- Daniel Goerz +1
-
Verified V +2
- Andreas Wolf +2
- Daniel Goerz +1
Issues 1
Files 4
- typo3/sysext/core/Documentation/Changelog/master/Breaking-71521-PropertyUserAuthenticationRemovedFromCommandController.rstnew+22 −0
- typo3/sysext/core/Documentation/Changelog/master/Important-71521-InternalChangesInCommandController.rstnew+10 −0
- typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php30+31 −19
- typo3/sysext/extbase/Tests/Unit/Mvc/Controller/CommandControllerTest.php+1 −1
Review log 56
Show 31 earlier messages
-
Mathias Brodala uploaded patch set 1 11/12/15, 14:57
-
Mathias Brodala uploaded patch set 2 11/12/15, 15:29
-
Mathias Brodala commented on patch set 2 11/12/15, 15:30
Rebased, removed placeholder in docblock. -
Oliver Eglseder commented on patch set 2 CR -1 V +1 11/14/15, 21:41
CommandController.php:17Import BackendUserAuthentication instead. The abstract one is not used here and the BE-UserAuth import is missing.CommandController.php:22The class is in the same namespace, this import is not needed. -
Mathias Brodala uploaded patch set 3 11/16/15, 08:22
-
Mathias Brodala commented on patch set 2 11/16/15, 08:22
CommandController.php:17ReplyDoneCommandController.php:22ReplyDone -
Mathias Brodala commented on patch set 3 11/16/15, 08:23
Fixed imports, rebased to master. -
Oliver Eglseder voted on patch set 3 CR +1 V +1 11/16/15, 11:41
-
Stefan Neufeind voted on patch set 3 CR +1 11/20/15, 10:34
-
Frank Nägler commented on patch set 3 CR -1 11/20/15, 10:50
in general I would prefer to shorten all namespaces of this class.CommandController.php:84shorten?CommandController.php:93shorten?CommandController.php:101shorten?CommandController.php:109shorten?CommandController.php:285$userAuthentication !== nullCommandController.php:301could be null, check is neededCommandController.php:377BackendUserAuthentication|null -
Mathias Brodala commented on patch set 3 11/20/15, 11:52
CommandController.php:84ReplyDoneCommandController.php:93ReplyDoneCommandController.php:101ReplyDoneCommandController.php:109ReplyDoneCommandController.php:285ReplyDoneCommandController.php:301ReplyDoneCommandController.php:377ReplyDone -
Mathias Brodala uploaded patch set 4 11/20/15, 11:53
-
Mathias Brodala commented on patch set 4 CR -1 11/20/15, 11:56
Uhm, Extbase doesn't support DI without FQCN yet, see https://review.typo3.org/38359 -
Mathias Brodala uploaded patch set 5 11/20/15, 11:56
-
Stefan Neufeind voted on patch set 5 CR +1 11/20/15, 12:15
-
Frank Nägler voted on patch set 5 CR +1 11/20/15, 13:13
-
Markus Sommer voted on patch set 5 CR +1 11/20/15, 14:33
-
Stefan Neufeind uploaded patch set 6 11/20/15, 16:52
-
Stefan Neufeind commented on patch set 6 11/20/15, 16:53
rebased. the use-statements didn't apply cleanly (hand-adjusted). Rest of the patch automatically applied. -
Stefan Neufeind commented on patch set 6 V -1 11/20/15, 16:54
Failing unit-test: TYPO3\CMS\Extbase\Tests\Unit\Mvc\Controller\CommandControllerTest::settingRequestAdminPropertySetsAdminRoleInUserAuthentication Exception: User role is not admin -
Stefan Neufeind uploaded patch set 7 11/20/15, 22:44
-
Stefan Neufeind commented on patch set 7 CR +1 V +1 11/20/15, 22:46
fixed test. unit-tests run fine now. -
Mathias Brodala commented on patch set 7 11/23/15, 08:58
Thanks for updating. :-) -
Benni Mack commented on patch set 7 11/24/15, 16:05
any reason why we need this in 6.2? -
Mathias Brodala commented on patch set 7 11/24/15, 16:16
I'd like to clean up the unit tests of command controllers within my extensions and so far injecting the ConfigurationManager requires me to mock unrelated things. Not a must have but still nice to have. -
Christian Kuhn commented on patch set 7 11/24/15, 17:05
not 6.2, unsure about 7, too. -
Mathias Brodala commented on patch set 7 11/25/15, 08:32
I'd like to see this in 6.2 since my extensions usually support both versions. If you have any qualms in general, please let me know. -
Helmut Hummel commented on patch set 7 CR -1 11/25/15, 11:12
I'm not particulary fond of introducing a getter for backendUserAuthentication and the rest is a simple cleanup that should just go into 8 It is totally out out of scope for 6.2CommandController.php:385what is the benefit of such a method compared to the property? -
Mathias Brodala commented on patch set 7 11/25/15, 12:04
CommandController.php:385ReplyIf it was a property, it must be filled somewhere which boils down to the constructor or initializeObject(). Both are not an option since this would require all deriving controllers to call the parent method for full setup. -
Mathias Brodala uploaded patch set 8 01/30/16, 18:37
-
Helmut Hummel commented on patch set 8 CR +1 01/30/16, 19:52
I'm not particulary fond of the getter which fetches a dependent object from globals, but I'm fine with the change
-
Claus Due commented on patch set 8 CR -1 01/31/16, 13:51
CommandController.php:69Removal should be described as breaking change.CommandController.php:105Arguments is not a singleton and should not be injected.CommandController.php:113ConsoleOutput is not a singleton and should not be injected. -
Mathias Brodala commented on patch set 8 02/01/16, 08:58
CommandController.php:69ReplyGood idea.CommandController.php:105ReplyI agree but I see no other option to reduce the responsibilities of the OM injection method aside from initializeObject() which, as I said, must then be called in deriving controllers if overridden.CommandController.php:113ReplySee above. -
Mathias Brodala uploaded patch set 9 02/01/16, 09:05
-
Mathias Brodala commented on patch set 8 02/01/16, 09:05
CommandController.php:69ReplyDone -
Mathias Brodala commented on patch set 9 02/01/16, 09:05
Added breaking RST for $userAuthentication property removal. -
Mathias Brodala wrote 02/01/16, 09:17
Patch set 10: Published edit on patch set 9. -
Mathias Brodala commented on patch set 10 02/01/16, 09:17
Fixed syntax in RST. -
Claus Due commented on patch set 10 02/02/16, 10:47
@Mathias I am concerned about these lines in the object container class. They trigger every time you try to inject a class that does not implement SingletonInterface: if ($classInfo->getIsSingleton() && !$instanceToInject instanceof \TYPO3\CMS\Core\SingletonInterface) { $this->log('The singleton "' . $classInfo->getClassName() . '" needs a prototype in "' . $injectMethodName . '". This is often a bad code smell; often you rather want to inject a singleton.', 1); } So doing this change would cause tremendous amounts of logging to occur with no way to avoid it. That's why I say injecting non-singletons is not allowed. It is actually specifically targeted as bad code smell. -
Mathias Brodala commented on patch set 10 02/02/16, 11:09
I fully understand the issue at hand but see no other option aside from adding another breaking change by introducing "initializeObject()" which would then be required to be called from deriving controllers in case they implement their own. -
Claus Due commented on patch set 10 02/02/16, 11:19
You could maybe put those ConsoleOutput instanciation in \TYPO3\CMS\Extbase\Mvc\Controller\CommandController::callCommandMethod which as far as I am aware sits before any output will be generated. And Arguments instanciation in \TYPO3\CMS\Extbase\Mvc\Controller\CommandController::initializeCommandMethodArguments -
Mathias Brodala uploaded patch set 11 02/02/16, 11:43
-
Mathias Brodala commented on patch set 11 02/02/16, 11:44
Moved arguments and output initialization to processRequest method. This seems to be the most reliable location. -
Claus Due commented on patch set 11 02/02/16, 11:46
The only reason I didn't suggest that method is that it's public API and so might be overridden; the others are protected and not marked as API and might be slightly "safer" to use. Personally I'm fine with processRequest() as well. -
Mathias Brodala commented on patch set 11 02/02/16, 11:52
> The only reason I didn't suggest that method is that it's public > API and so might be overridden; the others are protected and not > marked as API and might be slightly "safer" to use. Personally I'm > fine with processRequest() as well. I checked the other options; initializeCommandMethodArguments() is indeed an option for the arguments but output is already used in mapRequestArgumentsToControllerArguments() for interactive argument retrieval. -
Claus Due voted on patch set 11 CR +1 02/05/16, 23:07
-
Daniel Goerz commented on patch set 11 02/10/16, 22:44
CommandController.php:134Maybe we should mention the change of the public @api method in the breaking.rst. -
Mathias Brodala commented on patch set 11 02/11/16, 08:07
CommandController.php:134ReplyGood idea. Important would be enough though, right? It's not exactly breaking unless you completely override this method without calling the parent version. -
Mathias Brodala uploaded patch set 12 02/11/16, 08:12
-
Mathias Brodala commented on patch set 11 02/11/16, 08:13
CommandController.php:134ReplyDone -
Mathias Brodala commented on patch set 12 02/11/16, 08:13
Added Important RST about the change to CommandController::processRequest() as heads up for 3rd party code overriding this method. -
Daniel Goerz wrote 02/11/16, 08:16
Patch set 13: Published edit on patch set 12. -
Daniel Goerz voted on patch set 13 CR +1 02/11/16, 08:17
-
Daniel Goerz voted on patch set 13 V +1 03/05/16, 18:39
-
Andreas Wolf voted on patch set 13 CR +2 V +2 03/05/16, 22:56
-
Gerrit merged patch set 13 03/05/16, 22:56