When a field is in a fieldgroup, it displays twice when viewing the node. I think the field gets parsed once for the normal node and then again when the fieldgroup is called. are other people seeing this or did i miss a setting?
When a field is in a fieldgroup, it displays twice when viewing the node. I think the field gets parsed once for the normal node and then again when the fieldgroup is called. are other people seeing this or did i miss a setting?
Comments
Comment #1
yched commentedThis must be something in your theme - could you try switching back to Garland and see if there is still an issue ?
You are probably using a custom node-my_type.tpl.php to theme the nodes ? Pasting it here could help.
Comment #2
jyamada1 commentedhm. still the same duplicate fields after: trying zen and garland themes, turning off my "template.php" module and various other modules, clearing the cache after each change.
i am not using a custom node-content_myfield.tpl.php for the content types in which i am seeing this effect. i do have a node.tpl.php in my theme directory, little changed if at all yet, and it's pasted below. again, though, switching to other themes didn't help, so this can't be the problem. any other ideas where this duplication could be happening?
node.tpl.php
Comment #3
fagoDo you have some other modules installed that might cause that?
Comment #4
jyamada1 commentedstill can't figure this one out.
i've reinstalled garland and disabled all of the modules i could that seem to have an effect on cck. of course, i had to leave some of the cck field modules so i could see the content. disabling fieldgroup gets rid of all the fields (duplicates too) that are in fieldgroups.
Comment #5
bltinnel commentedI've seen the same thing but only when using Firefox (Windows or Mac OS/X) or Safari (Mac OS/X). When I use IE7 on Windows everything looks fine.
Comment #6
bltinnel commentedSorry about that. I wasn't watching what I was doing. It looks like the difference is logging on as the administrator vs. logging on as a "normal" user. The administrator lists the fields correctly, the normal users lists them twice. At least that is what is happening to me.
Comment #7
bltinnel commentedOk, a bit more info. In my case, the SQL being generated to get the values for the field is:
SELECT node_data_field_phonenum.field_phonenum_value AS value FROM {node} node
LEFT JOIN {content_field_phonenum} node_data_field_phonenum ON node.vid = node_data_field_phonenum.vid
WHERE node.nid = 329
ORDER BY node_data_field_phonenum.delta
Which returns one row when I run it. However, after being passed through db_rewrite_sql it becomes:
SELECT node_data_field_phonenum.field_phonenum_value AS value FROM {node} node
LEFT JOIN {content_field_phonenum} node_data_field_phonenum ON node.vid = node_data_field_phonenum.vid
INNER JOIN {node_access} na ON na.nid = node.nid
WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'term_access') OR (na.gid = 4 AND na.realm = 'term_access'))) AND ( node.nid = 329 )
ORDER BY node_data_field_phonenum.delta
The added INNER JOIN and additional WHERE clauses return 2 rows from node_access which causes the duplicate fields to be returned. Is this a CCK issue or a Node issue?
Comment #8
bltinnel commentedNot sure if this is useful, but I fixed this on my site by changing the generated SQL to:
SELECT DISTINCT(node_data_field_phonenum.delta), node_data_field_phonenum.field_phonenum_value AS value FROM {node} node
LEFT JOIN {content_field_phonenum} node_data_field_phonenum ON node.vid = node_data_field_phonenum.vid
WHERE node.nid = 329
ORDER BY node_data_field_phonenum.delta
I did this by changing a line in function content_views_field_handler_group from
$query = "SELECT ". implode(', ', $query_columns) .
to
$query = "SELECT DISTINCT(node_data_$field[field_name].delta), ". implode(', ', $query_columns) .
In my case there is only one column being queried (phonenum), but I think this fix will work for multiple columns. Hopefully someone with much more knowledge about CCK will look at this and determine if it is safe.
Comment #9
dopry commentedcannot reproduce on latest 1.x