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
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.

AttachmentSize
delete.patch515 bytes

#1

kratib - May 18, 2009 - 18:05

Are you sure the node doesn't get deleted? It does on my installation.

#2

brnnrc - May 25, 2009 - 16:09

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

kratib - May 25, 2009 - 16:15
Assigned to:Anonymous» kratib

Ah! I understand now. The reason why node_save gets 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

brnnrc - June 4, 2009 - 08:55

I forgot to say that I'm using pathauto to create automatic aliases.

#5

kratib - October 3, 2009 - 20:30
Component:Code» Actions
 
 

Drupal is a registered trademark of Dries Buytaert.