File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -82,15 +82,24 @@ public function run($url = null)
8282 $ controller = $ params [1 ] ?? 'index ' ;
8383 $ isApp = strtolower ($ module ) === 'app ' ;
8484
85- self ::$ action = $ action = isset ($ params [2 ]) ? $ this ->parseAction ($ params [2 ]) : 'index ' ;
86- self ::$ params = $ controllerParams = array_slice ($ params , 3 );
8785 $ controllerClass = "{$ module }\\Controllers \\{$ controller }" ;
8886 $ controllerBase = $ isApp ? base_path () : base_path ('modules ' );
89- if ($ controllerObj = $ this ->findController (
90- $ controllerClass ,
91- $ action ,
92- $ controllerBase
93- )) {
87+
88+ // Try finding the controller first with the original action
89+ $ originalAction = $ params [2 ] ?? 'index ' ;
90+ $ controllerObj = $ this ->findController ($ controllerClass , $ originalAction , $ controllerBase );
91+
92+ // Use the original action for WildcardController, otherwise transform the action
93+ $ action = $ originalAction ;
94+ if (!($ controllerObj instanceof WildcardController)) {
95+ $ action = $ this ->parseAction ($ originalAction );
96+ $ controllerObj = $ this ->findController ($ controllerClass , $ action , $ controllerBase );
97+ }
98+
99+ self ::$ action = $ action ;
100+ self ::$ params = $ controllerParams = array_slice ($ params , 3 );
101+
102+ if ($ controllerObj ) {
94103 if (!$ isApp && !System::hasModule (ucfirst ($ module ))) {
95104 return Response::make (View::make ('backend::404 ' ), 404 );
96105 }
You can’t perform that action at this time.
0 commit comments