Is there a way to automate the equivalent of Edit then Save (resave) on a node?

Events happening in the community are now at Drupal community events on www.drupal.org.
aharown07's picture

Briefly why I want to do this: there's a known bug in D6 that has something to do with presave... the result in my case is that a forum-enabled custom content type that is scheduled with Scheduler, will publish as scheduled without a row in the forum table. It gets the taxonomy, so it shows in the forum list but appears there as though it's been moved.
However, if I do an Edit and then Save on the node after it publishes, it get's it's forum table record and everything's lovely.

I've tried several Rules based approaches to automating this. One was a When viewed, save (conditions on content type and a field to keep it from repeating). This works but only if the user doing the content view trigger has the right permissions (not sure why that matters, but it does in my tests)

VBO node save doesn't work. The save works but apparently the save method is the same as Scheduler module (node_save_action ?) and so has the same result.

But Edit, then save, works every time... uses a different method? (node_save maybe?)

So is there some way to either make Rules do an Edit -Save or some way to programatically save with node_save... or some other idea?
It's a relatively small problem but driving me crazy.

Comments

Automate saving resaved

Stomper's picture

I think I am having the same issue as you, but in my case it has to do with automated node titles. I have used the nid in the automated node title, but since nids are created after creation and not at "submit" i have to manually edit and resave each node for the title to change.

I'd like to automate this process. Perhaps VBO? (http://drupal.org/node/740608)

I also am having the same

wuertele's picture

I also am having the same issue. In my case, it is because I have a calculated field that recursively edits parent nodes that depend on the node being saved. But the calculated field is not saved to the database, so when the parent nodes go to access the calculated field of the child node, they see the old value. After the save of the child node completes, if I then edit the child node again, and save, the parent gets the correct value from the child's database entry.

Module

aharown07's picture

Looks like I'm going to have to learn to make modules and code one to do this. In my case, it's really just a matter of using a different save method. I could probably patch Scheduler module to do it. The author is not interested since the problem is not his module. He's right, but that would be a way to fix it.

VBO.... so far my vbo efforts haven't solved the problem either.

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: