Skip to content
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

Fix redirect add admin action and possible others. #127

Merged
merged 1 commit into from
Jan 23, 2015

Conversation

Maff-
Copy link
Contributor

@Maff- Maff- commented Jan 22, 2015

I noticed the 'Add Redirect' action was broken in the admin interface (illegal offset error), and it turns out the RedirectAdminListController makes a wrong call to AdminListController::doAddAction [1].

This was also the case in some other controllers, which I also fixed.

// RedirectAdminListController.php
public function addAction(Request $request)
{
    return parent::doAddAction($this->getAdminListConfigurator(), $request);
}

But the method signature has $type as the second parameter:

/**
 * Creates and processes the form to add a new Entity
 *
 * @param AbstractAdminListConfigurator $configurator The adminlist configurator
 * @param string                        $type         The type to add
 *
 * @return array
 */
protected function doAddAction(AbstractAdminListConfigurator $configurator, $type = null, Request $request = null)
{
    // ...
}

the third @param is missing btw

We could also add a check in the doAddAction method, but that seems very ugly and a bit unnecessary.

if ($request === null && $type instanceof Request) {
    $request = $type;
    $type = null;
}

AdminListController::doAddAction accepts Request as third parameter, not second
roderik pushed a commit that referenced this pull request Jan 23, 2015
Fix redirect add admin action and possible others.
@roderik roderik merged commit d91adf6 into Kunstmaan:master Jan 23, 2015
@roderik roderik modified the milestone: Q1 2015 - v3.1 Feb 28, 2015
@roderik roderik modified the milestones: 3.1.0, 3.4.0, 3.0.1 Apr 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants