Hey there,

I'm using prepopulate module with this module to create nodes one after the other, but I need those nodes to remember a cck nodereference field NID.

I inserted the normal path from the prepopulate module which is :

/node/add/antecedent?edit[field_patient_reli][nids]=INSERTNIDHERE

I replaced the INSERTNIDHERE part with the token [field_patient_reli-nid] which is taken from the token interface in node go to.

when I submit a node, here's the url I get :

http://209.31.179.79/osteo/node/add/antecedent?edit[field_patient_reli][...

So the token is actually not replaced at all by the actual value. If I change the value of the token by hand, the right option is preselected in the nodereference dropdown... so the url itself should work.

Any ideas why this does not work??

Thanks,
Patchak

Comments

patchak’s picture

Please, any comment or advice on this issue?? What should I look for??

patchak’s picture

I posted a bounty about this issue here, cause I need it looked at very fast, in case anyone here is interested.

http://drupal.org/node/241228

pobster’s picture

You only really had to read the USAGE.txt file which came with the module; http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/prepopulate...

Just prefix what you're referencing with &edit, so it becomes;

http://209.31.179.79/osteo/node/add/antecedent?edit[field_patient_reli][...

I don't even use this module (and I didn't install it) I just read the instructions!

Note, if it doesn't work then I don't think it's meant to work in the way you're doing it... Reading through *all* the instructions to reference a field you'd use &edit[...], that's how it copes with multiple replacements too - not helpful to you as the '&' is another query and you want to reference a field within a field...

...But meh - I reckon it'll work ;o) The author wrote in the USAGE.txt file under 'Bookmarklets' that this is how he references stuff dynamically for bookmarking things.

Pobster

pobster’s picture

If there is still a bounty, I'd very much appreciate it as I virtually got made redundant on Tuesday last week...

Thanks,

Pobster

patchak’s picture

Status: Active » Fixed

Turns out I missed to add the &edit[...] in the string, sorry for the trouble...
patchak

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

introfini’s picture

@pobster: thanks for helping with the issue queue.

introfini