Permalink
Browse files

Fixed deleting objects.

  • Loading branch information...
1 parent 82f314c commit 1f471b99b509b53b0de44b9b4febad49e8ced4d8 @nigelgbanks nigelgbanks committed Apr 30, 2012
Showing with 7 additions and 5 deletions.
  1. +4 −2 content_model_viewer.module
  2. +3 −3 js/ManagePanel.js
View
6 content_model_viewer.module
@@ -648,13 +648,15 @@ function content_model_viewer_purge_object($pid) {
}
$success = $item->purge();
$message = $success ? t('Successfuly deleted object %l', array('%l' => $label)) : t('Failed to delete object %1', array('%l' => $label));
+ drupal_set_message($message);
if (isset($_POST['dsm']) && $_POST['dsm'] == 'true') {
drupal_set_message($message);
+ drupal_goto($collection);
}
else {
- echo json_encode(array('success' => $success, 'msg' => $message));
+ echo json_encode(array('success' => $success, 'msg' => $message, 'l' => url($collection)));
+ exit();
}
- $success ? drupal_goto($collection) : exit();
}
/**
View
6 js/ManagePanel.js
@@ -120,8 +120,8 @@ Ext.onReady(function(){
url: ContentModelViewer.properties.url.object.purge,
waitMsg: 'Purging...',
success: function(form, action) {
- history.go(-1);
- },
+ window.location = action.result.l;
+ },
failure: function(form, action) {
switch (action.failureType) {
case Ext.form.action.Action.CLIENT_INVALID:
@@ -417,7 +417,7 @@ Ext.onReady(function(){
action.set({
value: 'edit'
});
- document.forms["datastream-edit-form"].submit();
+ document.forms["datastream-edit-form"].submit();
}
}
}, {

0 comments on commit 1f471b9

Please sign in to comment.