needed that for a client, the attached patch does exactly that.

Comments?

CommentFileSizeAuthor
cck-nref-formatters-1.patch1.02 KBray007
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Status: Needs review » Fixed

I 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 :-)

ray007’s picture

Just 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.

yched’s picture

When 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 :-).

ray007’s picture

ah, 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?

Anonymous’s picture

Status: Fixed » Closed (fixed)
yched’s picture

The '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.

ray007’s picture

Yes, 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.

yched’s picture

When 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...)

moshe weitzman’s picture

I agree that it is worth saving users from themselves in this case. Will happen fairly often.