Using a group that is both defined as a content profile and an organic group type.

Made a view of users, related through content profile to get node/group information. Added a custom field who's parent is og_views_handler_field_og_subscribe.

Since this is a user's view, there's no $values->nid, which og_views_handler_field_og_subscribe is trying to access!

Looked around and looks like a few others may be having this issue, but attach patch just addresses og_views_handler_field_og_subscribe and isn't exactly tested, thus marking it needs work. Got my custom handler working based on what doing in patch though.

This issue also would affect using relationships (wrong nid would be used likely).

(Sorry if duplicate, looked but no cigar!)

Comments

hefox’s picture

Here's the patch to fix it in og_views_handler_field_og_group_nids.

hefox’s picture

Title: At least one og views handlers is using wrong/undefined nid in some occasions » Several og views handlers is using wrong/undefined nid in some occasions
Status: Needs work » Needs review
StatusFileSize
new4.24 KB

Not tested, but think I got em all

hefox’s picture

StatusFileSize
new5.3 KB

member count didn't have nid defined

Grayside’s picture

Priority: Normal » Major
StatusFileSize
new6.02 KB

Reroll with --relative. Found another one in the is_admin handler, fixed a regression in the subscribe link field.

While this isn't a significant issue for OG as a whole, for the OG Views component I would call this Major.

amitaibu’s picture

Haven't tested, but patch looks good, and removing the hardcoded nid makes sense.

Grayside’s picture

Status: Needs review » Fixed

Looking at this more, it's all good. I'm a bit nervous about proceeding with this, but I don't want it to be held up waiting for additional testers when I'm feeling good about an easy win. I've started work in #1311190: Create Tests for OG Views to get some test coverage for this stuff, one of the primary use cases I want to add is making sure a View that accesses the OG field handlers via a relationship or two gets the data.

http://drupalcode.org/project/og.git/commit/e21a2ce

Status: Fixed » Closed (fixed)

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