I've created a page that is posted to an Organic Group. This page contains an Insert View tag (for a tabular view). This causes my view to be neatly displayed on the group's home page. Very nice! Thanks! :-)

However, when the view is empty all the other pages posted to the group disappear from the group's home page.

The mission statement for the group appears but I'm also told "No posts in this group". I'm able to test easily since my view has an exposed filter, which is normally set to something sensible. However, when I set the filter to something impossible then everything disappears. I can add other content around the [view:myview] tag but it doesn't help.

I've looked at the code in insert_view.module and it seems very straightforward. I can't see why this would happen. There appears to be a straightforward textual substitution happening. The only thing that occurs to me is that views.module is using some sort of global variable to indicate that a view is empty and it is being seen by the code generating the outer view (i.e. the group). However, I can't find anything like that... :-(

I've noticed that insert view can't be used directly in a view but this seems to be a different issue, since the nodes that make up the organic group appear to be processed separately and then combined to form the organic group's home page. Everything works as I expect... but only when the view is not empty.

Any ideas?

Thanks...

Comments

mlsamuelson’s picture

Does your view have any arguments or filters with the "default" set to "return page not found" instead of "display all values"?

mlsamuelson

Martin.Schwenke’s picture

[Sorry for the delay in responding. I subscribed to my own issues for this project... but got no email... :-( Will check back more often!]

I don't completely understand the question because I don't see those options - this could be because I haven't used view arguments (yet).

The view in question doesn't have any arguments or exposed filters.

The 2 filters are:

  • A comparison of Node:Type against a particular content type that I've created.
  • A check to see if a (flat) taxonomy field is one of two particular values. I've specified no options (for depth).

How's that?

mshaver’s picture

I'm not sure this is specific to "insert view". I have a block with a filter that specifies to only display in a particular organic group. It works as advertised, with the block only showing up if there are in fact nodes that belong to that group. The problem is that it affects the group home page view, returning "No posts in this group.", when in fact there are. I don't have any arguments being passed in this block view, so it must be something with the organic groups module? I've searched for this issue there, but not found anything yet.

mlsamuelson’s picture

Martin.Schwenke and mshaver,

I've committed updates to Insert View that now make it function as a regular filter module (rather than as a pseudo filter). Can you try using the recently released 5.x-1.0 version and then let me know if the problem persists?

(Note: because of the change from a pseudo filter to a regular filter, you'll want to visit your site's admin/settings/filters and click the "configure" links for any input formats that use Insert View and then resave the settings to force the module's cache settings changes to take effect.)

mlsamuelson

mshaver’s picture

I don't have "insert view" enabled on my install, so I don't think it is entirely related to this module. I have a feeling it is more closely related to Organic Groups.

mlsamuelson’s picture

Project: Insert View » Organic Groups
Component: Code » og.module

Then this issue is in the wrong queue. :) Changing the project...

mlsamuelson’s picture

Project: Organic Groups » Insert View
Component: og.module » Code

Er, wait. changing it back to Insert View because the _original issue_ was Insert View related.

@mshaver: I'll leave it for you to create an issue in the Organic Groups queue.

moshe weitzman’s picture

Yes, it is probably GLOBALS['current_view''] being confused. the fix is probably to use a panels powered group home page. see two techniques at http://www.tejasa.com.

Martin.Schwenke’s picture

This doesn't seem to help. I'll try upgrading the og module to see if it fixes the problem, as per http://drupal.org/comment/reply/217279/787959#comment-791208 .

Martin.Schwenke’s picture

However, Moshe's comment helps... and I've installed og-6.0-rc5 and it solves the problem! So, assuming this issue tracker supports the functionality, this can be marked as a duplicate of http://drupal.org/node/241773 .

Thanks to everyone! :-)

moshe weitzman’s picture

Status: Active » Closed (duplicate)