Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
needed that for a client, the attached patch does exactly that.
Comments?
Comment | File | Size | Author |
---|---|---|---|
cck-nref-formatters-1.patch | 1.02 KB | ray007 |
Comments
Comment #1
yched CreditAttribution: yched commentedI finally committed a slight variation (see http://www.drupal.org/node/65133)
I decided to display the node links (taxo, 'see more' etc...), following the behaviour of the 'teaser list' and 'full nodes' Views styles.
Thanks for bumping this anyway :-)
Comment #2
ray007 CreditAttribution: ray007 commentedJust a small suggestion: when displaying node (full or teaser) the db_query for title is unnecessary ... the
if(!isset($titles[$item['nid']])) { ...
could be in the else of the other if.Comment #3
yched CreditAttribution: yched commentedWhen displaying node (full or teaser) the db_query for title won't be executed, since we just used the loaded $referenced_node to populate $titles[$item['nid']], which is then set..
I balanced between adding an 'else {' or not, and, well, finally did not :-).
Comment #4
ray007 CreditAttribution: ray007 commentedah, yes ... I should look closer before commenting ;-)
another question: what would you think about a 5th formatting option 'custom' to call a user-defined theming function?
Comment #5
(not verified) CreditAttribution: commentedComment #6
yched CreditAttribution: yched commentedThe 'full node' / teaser' formatters raised 'infinite recursion' issues with reference cycles : when a node refers itself, or when A refers B, which refers A...
Committed some code that should hopefully work around that.
Comment #7
ray007 CreditAttribution: ray007 commentedYes, I'm aware that this could lead to potential recursions.
But I wouldn't expand too much time to protect the user from doing something stupid - powerful tools can be used to do stupid things.
Comment #8
yched CreditAttribution: yched commentedWhen you edit B, you might not know that A already references it, so having it reference A back is not something particularly stupid.
I agree that 'full node' display on several levels might be odd anyway, so the error was probably not that frequent, but on a general note, I'm not willing to let cck have these kind of 'holes' around some of its features.
That is also why I'm currently being that conservative with the patches (OK, that _and_ not being able to dedicate enough time to the issue queue...)
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedI agree that it is worth saving users from themselves in this case. Will happen fairly often.