Skip to content
Snippets Groups Projects
Commit 413ece26 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

allow url parameters when no action is given, fixes #1538

Closes #1538

Merge request studip/studip!956
parent 49e0bc53
No related branches found
No related tags found
No related merge requests found
......@@ -257,10 +257,10 @@ abstract class StudipController extends Trails_Controller
// Try to create route if none given
if ($to === '') {
$to = $this->parent_controller
$args[0] = $this->parent_controller
? $this->parent_controller->current_action
: $this->current_action;
return $this->action_url($to);
return $this->action_url(...$args);
}
// Create url for a specific action
......
......@@ -197,6 +197,7 @@ final class StudipControllerTest extends Codeception\Test\Unit
{
return [
'0-action' => ['dispatch.php/studip_controller_test/foo'],
'0-action-and-parameter' => ['dispatch.php/studip_controller_test/foo?bar=42', '', ['bar' => 42]],
'1-action' => ['dispatch.php/foo', 'foo'],
'1-action-and-parameter' => ['dispatch.php/foo?bar=42', 'foo', ['bar' => 42]],
'1-action-and-parameters' => ['dispatch.php/foo?bar=42&baz=23', 'foo', ['bar' => 42, 'baz' => 23]],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment