-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 form controller redirect with empty context option #3324
fix form controller redirect with empty context option #3324
Conversation
@tim0991 please test if this code works instead (changing the // Get the redirect for the provided context
$redirects = [$context => $this->getConfig("{$redirectContext}[{$redirectSource}]", '')];
// Assign the default redirect afterwards to prevent the
// source for the default redirect being default[redirect]
$redirects['default'] = $this->getConfig('defaultRedirect', '');
if (empty($redirects[$context])) {
return $redirects['default'];
}
return $redirects[$context]; |
yes, you are right |
@tim0991 Please test this code. You still haven't added If you could also add some unit tests for this functionality that would be greatly appreciated. |
I'm sorry for my carelessness, and i do not know how to write unit test until now. |
So are you planning on adding unit tests to this PR or are you talking about doing it in the future? |
Maybe in the future |
Okay, so is this PR done then? Ready to be merged? @tim0991 |
Yes, it is a small change |
* commit 'd220cd2d5705d730832b2ec89707fae5b28f2fcb': (38 commits) Added ability to list records with colors Better check for default deletion redirect (octobercms#3324) Use cms.storage.uploads.disk instead of filesystem.default Fix 'illegal string offset' warning (octobercms#3331) Fixes octobercms#3315 Fix typo (octobercms#3326) Support toggling the removal of stop words in input preset handling (octobercms#3320) Trigger fileupload form field change on file removal (octobercms#3319) Initialize missing variable (octobercms#3318) Bring Finnish language up to date (octobercms#3316) Add default ports on database config (octobercms#3308) Typo fix Allow overriding form config in arbitrary contexts Update client.php (octobercms#3292) Change default environment to development (octobercms#3288) Save relations first in model saver This aligns better with the relation principal "parent saves child" / "child cannot save parent" and is more conducive to the natural workflow of a coder, ie Removes non functional buttons in pivot mode Refs https://github.com/daftspunk/oc-test-plugin/issues/28 Fix deprecated calls. (octobercms#3283) Improved inline docs Updating validation messages translations (octobercms#3261) ... # Conflicts: # config/database.php # config/environment.php
When i delete a data in update page, it will not going to redirect, because i did not specify delete context
so this commit is set
defualtRedirect
to defualt context if there is no matched context