Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG Redisplay CMS forms with validation errors

Guess the fragment based on the returned HTML.
The validation error HTTP response is generated by Form rather than
the controller (LeftAndMain), so we can't set custom PJAX headers easily.
  • Loading branch information...
commit 3156e75548526ca2119cde0ec095481262ba2cd4 1 parent ac59895
Ingo Schommer chillu authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 admin/javascript/LeftAndMain.js
6 admin/javascript/LeftAndMain.js
View
@@ -328,7 +328,7 @@ jQuery.noConflict();
* Can be hooked into an ajax 'success' callback.
*/
handleAjaxResponse: function(data, status, xhr) {
- var self = this, url, selectedTabs;
+ var self = this, url, selectedTabs, guessFragment;
// Pseudo-redirects via X-ControllerURL might return empty data, in which
// case we'll ignore the response
@@ -343,7 +343,9 @@ jQuery.noConflict();
newFragments = data;
} else {
// Fall back to replacing the content fragment if HTML is returned
- newFragments['Content'] = data;
+ $data = $(data);
+ guessFragment = $data.is('form') ? 'CurrentForm' : 'Content';
+ newFragments[guessFragment] = $data;
}
// Replace each fragment individually

4 comments on commit 3156e75

Juerg Rast

Is it possible that this change causes problems with the Navigation in the CMS?
See this Forum Post for a detailed description and screenshots of the problem: http://www.silverstripe.org/customising-the-cms/show/20470

Hamish Friedlander

Could well be. It's the cause of http://open.silverstripe.org/ticket/7702 which looks similar

I'm working on a fix now.

Juerg Rast

Wow, that was damn fast!

Jep, seems to bee the same!
I tried with git bisect to locate the correct revision and this is the first one with the Bug.

Hamish Friedlander

Cool. There's a fix in branches/3.0 and branches/3.0.1 now - let me know if that doesn't fix your issue.

Please sign in to comment.
Something went wrong with that request. Please try again.