Please can you comment on the completeness of views/spaces integrations. Both Content in ... currentspace/current feature lead to what looks like a stub. Is this complete?

stub(?) contents....

Configure filter criterion: Spaces: Content in current space
For
Filters content to only those that belong to the current space.
Hide More
Administrative title
This title will be displayed on the views edit page instead of the default one. This might be useful if you have the same item twice.

===

Thanks

Comments

Advin’s picture

Also interested in this filters. Use spaces taxonomy and views but when filter (content in current space) enabled views output nothing.

On drupal 6 all works perfectly...

Are filters works properly or it is in development?

adf1969’s picture

StatusFileSize
new1009 bytes

From what I can tell, the code written in spaces_og.inc:views_filter() is written imprecisely.
It has this:

switch ($base_table) {
      case 'node':
        $table = $query->ensure_table('field_data_group_audience', $relationship);
        $query->add_where(0, 'field_data_group_audience.group_audience_gid', $this->og->gid, '=');        
        break;
      case 'users':
        $table = $query->ensure_table('og_membership', $relationship);
        $query->add_where(0, 'og_membership_users.gid', $this->og->gid);
        break;
    }

But that is a problem, since $table might be something *other* than 'field_data_group_audience' (in fact, it will MANY times be different).
I changed my code to:

switch ($base_table) {
      case 'node':
        $table = $query->ensure_table('field_data_group_audience', $relationship);
        //$query->add_where(0, 'field_data_group_audience.group_audience_gid', $this->og->gid, '=');
        $query->add_where(0, $table.'.group_audience_gid', $this->og->gid, '=');
        break;
      case 'users':
        $table = $query->ensure_table('og_membership', $relationship);
        //$query->add_where(0, 'og_membership_users.gid', $this->og->gid);
        $query->add_where(0, $table.'.gid', $this->og->gid);
        break;
    }

And it works fine.
Note the lines I commented out and those I added.
I attached a patch with my changes.

Hope that helps.

Andrew.

Dean Reilly’s picture

Version: 7.x-3.0-alpha1 » 7.x-3.x-dev
Category: support » bug
Status: Active » Needs review
StatusFileSize
new1.07 KB

@Advin, I ran into this as well. It looks like the views filter wasn't updated to work with the schema changes in Drupal 7. I've attached a patch which fixes the issue.

Advin’s picture

Dean, thanks a lot!

webflo’s picture

Status: Needs review » Fixed

Thanks for the patches. I committed them both.

Commit 678f47d and 68610c2.

Status: Fixed » Closed (fixed)

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