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

Invalid redirection url #339

Open
b4rtaz opened this issue Mar 28, 2016 · 0 comments
Open

Invalid redirection url #339

b4rtaz opened this issue Mar 28, 2016 · 0 comments

Comments

@b4rtaz
Copy link

b4rtaz commented Mar 28, 2016

Hello!

When i am saving form then i am redirected to invalid address.

Example: admin/model_name//edit

Url doesn't has id, because my model doesn't has column 'id'.

Bellow code is current (AdminController.php):

if ($nextAction == 'save_and_continue') {
    $response = redirect()->to($model->getEditUrl($createForm->getModel()->id));
}

Bellow fix:

if ($nextAction == 'save_and_continue') {
    $newModel = $createForm->getModel();
    $primaryKey = $newModel->getKeyName();
    $response = redirect()->to($model->getEditUrl($newModel->{$primaryKey}));
}

Regards.

@b4rtaz b4rtaz changed the title Invalid redirect url Invalid redirection url Mar 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant