Merge branch 'post-2.4-integration' into post-2.4-upstream

This commit is contained in:
Ingo Schommer 2012-01-13 17:26:38 +01:00
commit a1b76798df
2 changed files with 18 additions and 1 deletions

View File

@ -423,6 +423,15 @@ SiteTreeNode.prototype = {
return false;
}
// Special case for VirtualPage: Check that original page type is an allowed child
if(Element.hasClassName(node, 'VirtualPage') && node.className.match(/VirtualPage-([^\s]*)/)) {
var nodeClass = RegExp.$1
if(nodeClass && newParent.hints.allowedChildren.indexOf(nodeClass) == -1) {
alert("You can't move a virtual page with an original type of '" + nodeClass + '" here');
return false;
}
}
var currentlyOpenPageID = 0;
if($('Form_EditForm').elements.ID) currentlyOpenPageID = $('Form_EditForm').elements.ID.value;

View File

@ -206,7 +206,15 @@ CMSForm.prototype = {
postBody: data,
onSuccess : success,
onFailure : function(response) {
errorMessage('Error saving content', response);
var msg;
// Only show plain responses, and trim them to avoid long stack traces
if(response.getResponseHeader('Content-Type', 'text/plain')) {
msg = response.responseText;
} else {
msg = 'Error saving content';
}
if(msg.length > 300) msg = longMsg.substr(0,300) + '...';
errorMessage(msg);
if($('Form_EditForm_action_save') && $('Form_EditForm_action_save').stopLoading) $('Form_EditForm_action_save').stopLoading();
_AJAX_LOADING = false;
}