Feature #36678

Complex Controllers don't work as BackendModule

Added by Marc Neuhaus over 3 years ago. Updated about 3 years ago.

Status:On Hold Start date:2012-04-27
Priority:Could have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:-

Description

In case of the ContentManagement Module i use a quite complex controller which doesn't contain the Actions in itself and instead as seperate classes. Because of this i can only show the index action in BackendModules.

I've attached a diff to allow to disable the hasMethod check for the action through settings.yaml

This was the quickest and simplest way which came to my mind for this kind of thing. Maybe there's a better way i can't think of right now.

BackendModuleRoutePartHandler.diff Magnifier (691 Bytes) Marc Neuhaus, 2012-04-27 18:14

BackendModuleRoutePartHandler.diff Magnifier (718 Bytes) Marc Neuhaus, 2012-05-25 14:39

History

#1 Updated by Aske Ertmann about 3 years ago

  • Status changed from New to Needs Feedback
  • Assigned To set to Marc Neuhaus

Just trying to understand. The controller doesn't contain the actions in itself but instead as separate classes? Does that mean that the controller extends classes which have the actions or? Because if that's the case, we should make sure the reflection service check for method checks the classes that are extended as well.

#2 Updated by Marc Neuhaus about 3 years ago

For the ContentManagement Module i have an Controller wich searches for Classes implementing my ActionInterface.
Then the requested action will be initiated and called from inside the Controller. The actions don't inherit from the ActionController or the other way around. (https://github.com/mneuhaus/Foo.ContentManagement/blob/master/Classes/Core/Actions/ActionInterface.php)

Main reason for this design is to be able to override for example the list action for a certain entity.

I think the most universal option for such special cases would be an option to let the controller handle the action validation itself.

Greetings Marc

#3 Updated by Marc Neuhaus about 3 years ago

i don't now how, since the BackendModuleRoutePartHandler is unchanged, but it works now :)

#4 Updated by Marc Neuhaus about 3 years ago

wait, scratch that. only the index still works.
all the other functions aren't working.

Bastian suggested to solve this whole thing through an dispatch method, so maybe you could alternatively check for an dispatch method on the controller like in the patch attached?

#5 Updated by Aske Ertmann about 3 years ago

  • Status changed from Needs Feedback to Accepted
  • Assigned To changed from Marc Neuhaus to Aske Ertmann

The suggested solution of searching for a dispatch method might make sense, I will make sure to discuss it at a scrum meeting to get more feedback :)

#6 Updated by Marc Neuhaus about 3 years ago

I've just refactored the StandardController of the ContentManagement Package into a proper ActionRuntime similar to the FormRuntime which makes this request kind of obsolete.

If no one else thinks this should be considered, i'm ok if this gets closed/ignored.

:)

#7 Updated by Aske Ertmann about 3 years ago

  • Status changed from Accepted to On Hold
  • Assigned To deleted (Aske Ertmann)
  • Priority changed from Should have to Could have

Also available in: Atom PDF