You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gurkcity opened this issue
Apr 19, 2024
· 3 comments
· May be fixed by #36084
Labels
8.1.xBranchBugType: BugCOCategory: CoreHookModuleModuleNMIStatus: issue needs more informationWaiting for devStatus: action required, waiting for tech feedback
We have a module that wants to make an own Dispatch and needs to pass the information about the dispatched routes to the default PS Dispatcher in Hook actionAfterLoadRoutes. For this reason the protected variables "$controller" and "$front_controller" needs to be public or alternatively a setter methods is needed.
Currently this can be only achieved with an Override of Dispatcher.
Expected behavior
Both $controller and $front_controller can be set with a module through hook actionAfterLoadRoutes
Steps to reproduce
You need a module to hook into actionAfterLoadRoutes
Here is an example:
or with using a setter method:
line 12 will throw an error:
PHP Fatal error: Uncaught Error: Cannot access protected property Dispatcher::$controller in...
PrestaShop version(s) where the bug happened
8.1.5
PHP version(s) where the bug happened
8.1.27
If your bug is related to a module, specify its name and its version
No response
Your company or customer's name goes here (if applicable).
Gurkcity
The text was updated successfully, but these errors were encountered:
Hi @Hlavtox
thanks for looking into this.
I understand you if you are only interested in changing the routes. But our idea is to have more flexibility for a rewrite module that wants to find the correct controller not by default PS regex but by other way e.g. database query in selected tables. For this reason we must set the controller in this place. There is no other place suitable for this idea for a complete free set of rewrite rules.
8.1.xBranchBugType: BugCOCategory: CoreHookModuleModuleNMIStatus: issue needs more informationWaiting for devStatus: action required, waiting for tech feedback
Prerequisites
Describe the bug and add attachments
We have a module that wants to make an own Dispatch and needs to pass the information about the dispatched routes to the default PS Dispatcher in Hook actionAfterLoadRoutes. For this reason the protected variables "$controller" and "$front_controller" needs to be public or alternatively a setter methods is needed.
Currently this can be only achieved with an Override of Dispatcher.
Expected behavior
Both $controller and $front_controller can be set with a module through hook actionAfterLoadRoutes
Steps to reproduce
Here is an example:
or with using a setter method:
PHP Fatal error: Uncaught Error: Cannot access protected property Dispatcher::$controller in...
PrestaShop version(s) where the bug happened
8.1.5
PHP version(s) where the bug happened
8.1.27
If your bug is related to a module, specify its name and its version
No response
Your company or customer's name goes here (if applicable).
Gurkcity
The text was updated successfully, but these errors were encountered: