Could there be an additional setting for workspace which lets the admin control where the user ends up after a delete is executed for an entry in the workspace?

I was trying out your WONDERFUL module, but was a bit distracted by laddering back down the menu to get to my workspace items when I needed to delete 6 practice pages.

I was expecting to return to the workspace page after the delete completed, not to the main page of the website.

CommentFileSizeAuthor
#2 292017-return-to-workspace.patch1.05 KBdezofie

Comments

6174604’s picture

Yes, please make this come true :) I (We) need that too.

dezofie’s picture

Assigned: Unassigned » dezofie
Category: feature » task
Status: Active » Needs review
StatusFileSize
new1.05 KB

Hi guys,

I did this request, it will redirect to workspace page if node is deleted.

Note: this is my first patch! if somebody have suggestion or comment, let me know! thanks :)

luthien’s picture

hello, your patch failed.

Replace:

drupal_goto('node/$nid/delete', 'destination=workspace/$user->uid');

with:
drupal_goto('node/' . $nid . '/delete', 'destination=workspace/' . $user->uid);

thanks for the patch!

diego.pasc’s picture

Basically the patch is correct but fails just because dezofie used single quotes instead of double quotes in his patch.

Remember:
(assuming for example $row->nid=123):
'node/$row->nid/edit' -------> litterally print: node/$row->nid/edit
"node/$row->nid/edit" -------> print: node/123/edit

So replace:

$may_edit ? l(t('edit'), 'node/$row->nid/edit', array('query' => 'destination=workspace/$user->uid')) : '',
drupal_goto('node/$nid/delete', 'destination=workspace/$user->uid');

with:

$may_edit ? l(t('edit'), "node/$row->nid/edit", array('query' => "destination=workspace/$user->uid")) : '',
drupal_goto("node/$nid/delete", "destination=workspace/$user->uid");