mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge branch 'post-2.4-integration' into post-2.4-upstream
This commit is contained in:
commit
a1b76798df
@ -422,6 +422,15 @@ SiteTreeNode.prototype = {
|
||||
alert("You can't add children to that node");
|
||||
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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user