In CCK 3.x there is support for Multigroups. If you keep the NodeReference field out of the multigroup the "View" formatter works fine, but if you put the field inside a multigroup you get nothing (supposing NULL value).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

What's CCK3? I don't see it on the CCK project page.

looplog’s picture

CCK 3.x is a branch for new features of CCK. You'll find it in the releases page. I'm having the same problem, though I did get a more specific error message that may help. If I choose view for the nodereference field in a multigroup and format the subgroup as a table, then I get the null result. If I just output the field in an unstyled subgroup, I get the following error:

warning: Illegal offset type in isset or empty in /srv/www/htdocs/61309/includes/theme.inc on line 590.

joachim’s picture

Category: support » feature

The problem is going to be earlier than that: you'd have to have a look at that comes into theme_nodereference_views_formatter_views($element).

I'm afraid I'm busy with other projects, so I don't have time to work on this. Furthermore, supporting a dev release is chasing a moving target, so I don't think it's really worth it.
Though if you're able to look into it and provide a patch that doesn't break 6-2 compatibility, I'll commit it.

tomsm’s picture

I also use CCK3 multigroup and "Node reference views" offers the extra functionality I am looking for.
So I hope that this feature will be added soon...

michellezeedru’s picture

Subscribing... also using CCK3 multigroup and would like to use node reference views in that context. Thanks!

BenK’s picture

+1 for this feature... CCK 6.x-3.x-dev with multigroups is actually quite stable. More than 5200 installations exist according to the usage page and the branch maintainer is very careful with it because he knows that a lot of people use this dev branch on production sites.

joachim’s picture

Status: Postponed (maintainer needs more info) » Active

I don't have the time to work on new features for this module, I'm afraid.

If you can work amongst yourselves and make and test a patch, I'll commit it and make a release :)

elektrorl’s picture

subscribing

t0b1’s picture

subscribe

drupalok’s picture

+1 for this feature! thanks for the great work!

Alexander Allen’s picture

Subscribe

dboulet’s picture

The problem here comes from the way that the formatter handles multiple values. The modules is designed to take all the nids from the node reference field and send them to the view as a single argument. Multigroup fields can't work like that—every item must be formatted seperately, so that it can be grouped with the items of other fields.

One solution I've found is to add a second formatter which renders only one item at a time. This is probably awful for performance, but it will work for multigroups.

looplog’s picture

Version: 6.x-1.1 » 6.x-1.2
Status: Active » Needs review

Tested the above patch and it seems to work.

joachim’s picture

CCK 3 still doesn't have even a dev release...

dboulet’s picture

CCK 3 still doesn't have even a dev release...

Sure it does, it's just not displayed on the project page. And according to usage statistics, it's currently being employed on roughly 13,000 sites.

joachim’s picture

Why does it not show on the project page then?

The problem I have here as maintainer is that between CCK 2 and 3 and View 2 and 3 there are 4 possible combinations of APIs to support. I'm not going to do all 4, obviously -- so the sane choice is to only do the recommended releases. When things have dev releases or alphas I'll consider how to handle branching this module in a meaningful way. Until then, this patch is postponed, sorry.

dboulet’s picture

Good point joachim, I completely understand. Not sure why CCK 3 isn't shown on the project page, but I'm guessing that development lagged a little while the maintainers were busy working on Drupal 7.

In defense of my patch, the new formatter is only added in presence of the 'Content Multigroup' module, so NRV will be unaffected without it. Then again, it's quite easy to implement my changes into a custom module.

Thanks for the feedback!

joachim’s picture

> In defense of my patch, the new formatter is only added in presence of the 'Content Multigroup' module, so NRV will be unaffected without it.

Ah! That's clever :)
Yes, in that case it should be fine to go in. Sorry; pushed for time like all maintainers and hadn't actually looked at the patch... Will deal with it when I have a spare moment; in the meantime one or two further reviews would be great.

joachim’s picture

Okay, now I actually look at this I see what it's doing.

Is there any information contained in $element that would indicate whether the current field is part of a multigroup? If so, then we could do everything in the one formatter, which would improve performance a little bit as we'd only call views_get_view() once.

dboulet’s picture

The problem is that, from what I can gather, fields in multigroups aren't compatible with formatters that have 'multiple values' => CONTENT_HANDLE_MODULE,. The formatter function simply doesn't get called at all.

joachim’s picture

Status: Needs review » Fixed

Ah, right.

Committed, with a minor tweak (no point in storing $nid if we only use if once).

#581110 by dboulet: Added support for CCK 3.x multigroups.

Thanks! :D

Don't think there's anything else in the issue queue that's going to get committed soon, so going to roll a release with this now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.