This patch adds the ability to update existing node reference fields.
If you have a lot of existing nodes with corresponding node references that aren't in sync there is currently no way to do so.
You have to remove the reference, save the node, add the reference again and save the node again and then it works.
So this adds a settings tab that allows you to do bulk cnr processing of nodes by content type.
I updated 3500 nodes in just under 30 seconds so it doesn't take that long either.
Patch is against 6.x-3.3
- Also, having no dev branches is a bit annoying for rolling patches as I can't guarantee that the patch will apply cleanly to the latest code without going into cvs to get it.
Comment | File | Size | Author |
---|---|---|---|
#10 | cnr-update_existing-805244-10.patch | 10.99 KB | Agileware |
cnr_update_existing.patch | 7.83 KB | Agileware |
Comments
Comment #1
domidc CreditAttribution: domidc commentedTest patch and include feature in next release.
Comment #2
tavaressimon CreditAttribution: tavaressimon commentedTried applying the patch to the latest version.
I get:
Hunk #1 FAILED at 11.
Hunk #2 FAILED at 150.
Hunk #3 FAILED at 244.
Am I doing something wrong?
Comment #3
sethcohn CreditAttribution: sethcohn commentedThis should use Batch API... doing this is bad:
Sites with 3500 nodes might take 30 seconds, but sites with 350,000 nodes(and having to node load all of them) would be taking 3000 seconds = ~50 minutes.
Comment #4
Agileware CreditAttribution: Agileware commentedAgreed. Will do this if I get some time soon.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedWow thanks! I was looking for this a while back. Good job, this should definitely be part of the module's features. Maybe even include a Status Report check "Your node references are not in sync".
Comment #6
joaomachado CreditAttribution: joaomachado commentedI would like this feature as well...this is a great module!
Comment #7
esclapes CreditAttribution: esclapes commentedI don't know if this is the place to ask for this, but it would be great if this patch could check if referenced node exist and remove nodereference when it does not.
I used views bulk operations to delete all nodes for a given node-type, but nodereference are still showing in the corresponding node-type.
Nodereference show only [nid:XXX] but node/XXX does not exist.
I will re-import my content (which create cnr without problems) and update again to see if this takes out the outdated references.
Comment #8
esclapes CreditAttribution: esclapes commentedNo, after re-importing content and updated, the deleted nodes are still referenced. They are not shown in my view, so this is not a big problem, but it would still be great to have that added if possible
Comment #9
DanGarthwaite CreditAttribution: DanGarthwaite commentedPatch WFM. Thank you.
Comment #10
Agileware CreditAttribution: Agileware commentedHere is the original patch modified to use batch processing.
On the update form an additional field allows you to choose how many nodes are processed per batch.
I have tested with 2500ish nodes 50 at a time and all seems to have gone well.
Comment #11
ashedryden CreditAttribution: ashedryden commentedApplied patch and it worked for me. Thanks!
Comment #12
j0nathan CreditAttribution: j0nathan commentedApplied patch in #10 on version 3.3 and it works. Thank you.
+1 for the idea in #5 : include a Status Report check "Your node references are not in sync".
Comment #13
momper CreditAttribution: momper commentedsubscribe
Comment #14
isaac.niebeling CreditAttribution: isaac.niebeling commentedPatch from #10 worked for me.
Comment #15
amonika CreditAttribution: amonika commentedI was having the same problem as tavaressimon. Using
>patch < cnr_update_existing.patch
instead of>patch corresponding_node_references.module < cnr_update_existing.patch
solved that.The patch is working for me.
Comment #16
Agileware CreditAttribution: Agileware commentedIf you put the patch from #10 in the cnr module directory it applies with:
For information on this see http://drupal.org/patch/apply
Comment #17
domidc CreditAttribution: domidc commentedThis patch is included in 6.4 release which is currently in dev