Closed (fixed)
Project:
Node Relativity
Version:
5.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
30 Sep 2007 at 11:21 UTC
Updated:
1 Apr 2008 at 22:44 UTC
Jump to comment: Most recent file
I use both moduls, automatic nodetitles and this relativity modul. the problem is, that if i create a node with automatic nodetitles there will be a sql bug. Even if the nodetype does not use relativity. Is there any solution for this problem?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | relativity node_load.patch | 658 bytes | thekk |
| #2 | relativity tokens-var.patch | 8.31 KB | thekk |
Comments
Comment #1
darius commentedThe description is not adequate. Maybe it's a Automatic Nodetitles issue?
Comment #2
thekk commentedNo, this is not a Automatic Nodetitles issue. This has to do with the fact that Automatic Nodetitles uses the token module to set the titles.
How to duplicate?
Install Node Relativity, Token and Automatic Nodetitles
Create a parent content type & node.
Create a child content type, set Automatic Nodetitles to autogenerate a title using the token module.
Create child node from parent and preview. This generates an error coming from node_load(), around line 521.
Upon debugging using:
in node.module, I found out that the calling function was 'relativity_token_values'... That function tries to create a full node using the 'nid' of a node, but because the function is called when the nid is not yet set, this gives an error in node_load().
I propose to remove the call to node_load, because it is expensive: it fires the load event of nodeapi. This effectively loads the node twice from the database, only to gather the parent_nid. In my case this was already available (and I haven't seen this construction anywhere else). This is fixed in the node_load patch.
Also: I found that the variable name for returning the token values is not consistent: declared as 'tokens', returned as 'values'. This is fixed in the tokens-var patch.
Comment #3
darius commentedHi,
could someone confirm that the proposed patch above (relativity node_load.patch) fixes the SQL problem and does not cause any other? In particular,
a) Omar: do you remember the reason for:
rather than simply
b) rsmith5: could you verify the patch fixes your problem?
For the reference, here is the original issue introducing token support: http://drupal.org/node/151731
As soon as we get some confirmation, I'll commit the patch.
Comment #4
owahab commentedI reviewed the patch and see it as RTBC.
Unless someone state otherwise, I'll commit this next week.
Comment #5
jody lynnHey we needed this patch too to fix the bug. Please commit! Thanks
Comment #6
darius commentedCommitted to 5.x-2.x-dev branch.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.