action "delete" delets aliase and recreates it
brnnrc - May 18, 2009 - 10:29
| Project: | Views Bulk Operations (VBO) |
| Version: | 5.x-1.3 |
| Component: | Actions |
| Category: | bug report |
| Priority: | normal |
| Assigned: | kratib |
| Status: | active |
Jump to:
Description
In _views_bulk_operations_action_do, you have:
if (_views_bulk_operations_is_actions_6()) { // Drupal-6-style actions
actions_do($action['callback'], $node, $context);
node_save($node);
}
So, it calls node_save and rebuilds the path alias just deleted.
Here you hava a stupid patch.
Thanks fori your great job.
| Attachment | Size |
|---|---|
| delete.patch | 515 bytes |

#1
Are you sure the node doesn't get deleted? It does on my installation.
#2
Node gets deleted! The path alias gets deleted and then recreated.
You can find all the aliases pending in the db table 'url_alias'.
The node doesn't get recreated because the node_save() calls an 'UPDATE ... where nid=x' and the row with nid=x is deleted. So nothing happens.
The alias gets dropped before the node_save() and recreated during the node_save() (with an INSERT) instead.
The question is: why the node_save() is called during a delete operation?
thanks!
#3
Ah! I understand now. The reason why
node_savegets called is that VBO has no way of differentiating between delete and any other action. This function needs to get called to commit the result of actions that modify nodes. I will search for a workaround in the case of delete action specifically.#4
I forgot to say that I'm using pathauto to create automatic aliases.
#5