开发者

Silently modifying nodes

I'm about to batch update every node in my database. Having made a recent change to my Auto Node Title rules, I'll be using Views Batch Operations to re-run everyone through ANT and potentially change their title.

I'd like to do this silently, and not have every single node appear in my recently modified view. Anyone know how to accomplish this?

I usually accomplish something like this by running SQL directly, but开发者_如何学JAVA in this case I need to piggyback on what I get for free from Auto Node Title.


The operation available through Views Bulk Operations is provided via hook_node_operations in the function auto_nodetitle_node_operations() and callback function auto_nodetitle_operations_update($nodes)

The change to the node title is saved to the database using node_save, which updates the last updated field in the database as part of its operations. If you were to hack the callback function to replace building the node object and calling node_save with SQL to directly update the node title, you will skip the timestamp update.

If you want to avoid hacking ANT (which I heartily suggest), you might implement another node operation or node action that provides this functionality and post it to the ANT issue queue, from whence it might be added to the module.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜