After upgrading to og-5.x-2.2 (using views-5.x-1.4, also run upgrade.php with no errors), when accessing either previously created groups or newly created groups, I get:

* warning: Invalid argument supplied for foreach() in /DATA/www/sites/all/modules/views/views_query.inc on line 81.
* warning: Invalid argument supplied for foreach() in /DATA/www/sites/all/modules/views/views_query.inc on line 16.
* warning: Invalid argument supplied for foreach() in /DATA/www/sites/all/modules/views/views_query.inc on line 189.
* warning: Invalid argument supplied for foreach() in /DATA/www/sites/all/modules/views/modules/views_node.inc on line 777.
* warning: Invalid argument supplied for foreach() in /DATA/www/sites/all/modules/views/views_rss.module on line 55.

When checking admin/og/og (Group Home Page section), there is no default view (River of news or similar).
Issue originally mentioned in http://drupal.org/node/127871 (my comments posted at http://drupal.org/node/127871#comment-213159).

Comments

petrescs’s picture

(Note: am using latest views-5.x-1.5 on Drupal 5.1)

Have noticed that if reverting from og-5.x-2.2 to og-5.x-1.x, /admin/build/views page actually shows some og related views (see below, sorry for raw copy/paste). However the behavior is similar, when entering any OG homepage I got the before-mentioned views related errors but at least I have a "river of news" OG homepage displayed after these errors.

With og-5.x-2.2, views admin page does not even show these og_* prefixed views - I think this might be producing the error (especially missing og_ghp_ron view, that is "river of news" for og homepage).

Anybody else noticed same og&views issues? Any hints on fixing this greatly appreciated. Thank you.

Default Views Default view Title Description Provides URL Status Actions
comments_recent Display recent comments block Block No Page View Enabled

* Add
* Disable

frontpage The basic front page view. Page frontpage Enabled

* Add
* Disable

og Groups groups directory Page, Menu og/all Enabled

* Add
* Disable

og_ghp_ron OG: Group home page - River of news. Default No Page View Enabled

* Add
* Disable

og_my My groups List user's subscribed groups and provide link to manage subscription Page, Menu og/my Enabled

* Add
* Disable

og_mytracker My recent Shows all activity in subscribed groups. Page, Menu group/mytracker Enabled

* Add
* Disable

og_tracker Recent posts Shows active posts across the whole site Page, Menu group/tracker Enabled

* Add
* Disable

og_unread My unread Shows unread posts in subscribed groups. Page, Menu group/myunread Enabled

* Add
* Disable

popular_alltime All-time popular content Nodes sorted by total page-views Page, Block, Menu popular/alltime Disabled

* Add
* Enable

popular_recent Recent popular content Nodes sorted by recent page-views Page, Block, Menu popular/latest Disabled

* Add
* Enable

taxonomy_term Taxonomy The taxonomy view with a depth of 0. Page taxonomy/term Disabled

* Add
* Enable

tracker Recent posts Shows all new activity on system. Page, Menu tracker Enabled

* Add
* Disable

petrescs’s picture

Part of the problem could be caused because of wrong path; lack of og related views is only when og and views modules are installed in multisite path /sites/all/modules - when moving them directly into /modules (and re-enabling og/views), following views are displayed on admin/build/views page.

og Groups groups directory Page, Menu og/all Enabled

og_ghp_ron OG: Group home page - River of news. Default No Page View Enabled

og_my My groups List user's subscribed groups and provide link to manage subscription Page, Menu og/my Enabled

og_mytracker My recent Shows all activity in subscribed groups. Page, Menu group/mytracker Enabled

og_search Search Search within a particular group Page og/search Enabled

og_tracker Recent posts Shows active posts across the whole site Page, Menu group/tracker Enabled

og_unread My unread Shows unread posts in subscribed groups. Page, Menu group/myunread Enabled

However, same errors displays when trying to access any OG homepage:

* warning: Invalid argument supplied for foreach() in /DATA/www/modules/views/views_query.inc on line 81.
* warning: Invalid argument supplied for foreach() in /DATA/www/modules/views/views_query.inc on line 16.
* warning: Invalid argument supplied for foreach() in /DATA/www/modules/views/views_query.inc on line 189.
* warning: Invalid argument supplied for foreach() in /DATA/www/modules/views/modules/views_node.inc on line 777.
* warning: Invalid argument supplied for foreach() in /DATA/www/modules/views/views_rss.module on line 55.

petrescs’s picture

Version: 5.x-2.2 » 5.x-1.x-dev
Priority: Critical » Normal

Looks like it's working now, the problem *could be* related to a hardcoded path in og.module.

Details:

- have disabled "broken" og and views modules and reinstalled latest og-5.x-1.x-dev and views-5.x-1.x-dev in _drupal_root_/modules folder. Then reenabled each of them in Admin/Modules page; when clicked on any existing OG, the respective homepage displayed pink error box as above. The good news, og related views (most importantly, og_ghp_ron) is now displayed by views page.

- in admin/og/og page, after re-enabling all parameters and saved page, the above error disappears and group homepages work as expected.

- disabled views module and moved it back to original multisite path (_drupal_root_/sites/all/modules), then re-enabled it - everything still works as expected.

- disabled og module and moved it back to multisite path (like above), then re-enabled it - BUM! now the OG homepage bug is once again displayed, just like described in previous posts.

I consider the problem could be a simple hardcoded path somewhere in og modules, that only allows OG to work if installed in _drupal_root_/modules.

One can reproduce the problem as follows:
- if og is installed in /modules path, /admin/og/og page displayes for Group Home Page section the following:

===
Presentation style:
* OG: Group home page - River of news. Default (og_ghp_ron)
Pick a View for your group home page. Only Views whose names start with og_ghp_ are eligible. The View determines the layout of your home page. You may alter the presentation using usual the usual Views themeing techniques. Also see the Theme section of the OG README file.
===
where the * before second line above is a checked radio-button

However, if the og module is NOT installed in above path, but in multisite path instead, _drupal_root_/sites/all/modules, the above section only displays

===
Presentation style:
Pick a View for your group home page. Only Views whose names start with og_ghp_ are eligible. The View determines the layout of your home page. You may alter the presentation using usual the usual Views themeing techniques. Also see the Theme section of the OG README file.
===

that is, *NO* radio button for OG default view - which I think it means no default view, and thus leads to errors displayed on every OG homepages...

Hope this helps - am not a programmer to figure out where the problem lies, can only guess is about a hardcoded path somewhere in one of the og modules.

moshe weitzman’s picture

Status: Active » Closed (fixed)

there is no hard coded path in og.module. if you move modules from their original installed position, you have to visit the modules page so drupal can correct self ... i guess you could have a stale views cache too ... there is no og issue here.

petrescs’s picture

As I said, am not a programmer to be able to tell it was hardcoded or not - the reason I suspected this is that all my modules are installed in multisite path (/sites/all/modules) and this OG homepage problem occurred right after upgraded to og-5.x-2.2. As soon as I moved the module to global path (/modules) and refreshed the modules page (yes I did that - visited modules admin page and re-submit it), the problem was solved. When I moved module it back to multisite path - bug occurred again.
Anyway, if this bug cannot be replicated by anyone else, must be a problem on my side - apologize.

greggles’s picture

I had a similar problem and it was caused by accidentally deleting the view that I had setup in my custom theme_og_view. I imagine the same problem would occur if the og_ron view were deleted from the admin/build/views screen.

petersecs - if you start over on a test site can you come up with a simple set of steps to cause your problem? That would help determine the precise cause of the bug which would make it easier for other people to troubleshoot and fix.

petrescs’s picture

Priority: Normal » Minor

Recently have upgraded to latest versions - both OG 5.x-3.1 and views 5.x-1.6-beta5 now work fine together in drupal_root/sites/all/modules. Guess case is closed. Thank you everybody for replies.

geek-merlin’s picture

subscribing

dugh’s picture

I see the same error just by upgrading the organic groups module, so it is an organic groups problem.

The og river of news view is gone. Uninstalling & reinstalling og doesn't fix that, neither does clearing the views cache.

christefano’s picture

dugh, this is a different issue (just look at the dates and version numbers). It sounds like you're having the problem being discussed at #278469.