1

I want to make automatic title like node-333, using auto nodetitle module. When creating node there is no nid, so pattern node-[node:nid] gives me after saving new content "node-". When I edit again this node - title is changing as expected.

So I thought, that using rules I do simple "After saving node" condition "Node type is" and action Execute php node_save($node). But it is not working, I'm getting

PDOException: SQLSTATE[23000]: Integrity constraint violation

Does anyone deal with this or have some workaround?

2

You are on the right track. I have been doing this for a while now with the following code snippet in rules.

auto_nodetitle_operations_update(array($node->nid));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.