-
Couldn't load subscription status.
- Fork 2
IBX-10170: Introduced AccessCheckController contract #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| public static function getSubscribedEvents(): array | ||
| { | ||
| return [ | ||
| ControllerArgumentsEvent::class => 'onControllerArgumentsEvent', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't kernel.controller event more appropriate?
This event is dispatched after the controller has been resolved but before executing it. It's useful to initialize things later needed by the controller...
kernel.controller_arguments has a different purpose.
This event is dispatched just before a controller is called. It's useful to configure the arguments that are going to be passed to the controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, it could be to early and arguments for controller are still not set. @adamwojs , did you tried mentioned one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked this out, and it seems that everything is working properly wirh kernel.controller.
| public function onControllerArgumentsEvent(ControllerArgumentsEvent $event): void | ||
| { | ||
| $controller = $event->getController(); | ||
| if (is_array($controller) && $controller[0] instanceof AccessCheckController) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this can also be an invoke'able object (with __invoke method). While we ourselves never use controllers like that, there is nothing stoping someone else from doing so - since it's in Contracts namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just moving this from admin-ui, but you are right - fixed.
Also, string callables with static methods are also possible so I tried to handle those as well.
f42b5e7 to
5b9f72d
Compare
5b9f72d to
0daae07
Compare
|
|
QA Approved on Ibexa DXP Commerce 4.6-dev. |



Description:
For QA:
Documentation: