Using og_forum 5.x-2.x-dev, Drupal 5.7, og 5.x-7.3 with the lines added for og_forum,
when posting a new forum topic as an authenticated user, I get:

* warning: reset() [function.reset]: Passed variable is not an array or object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1142.
* warning: key() [function.key]: Passed variable is not an array or object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1143.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1144.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1144.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1144.

The Forums selection box is there. The page looks OK except for the warning messages.
When I submit the forum topic, the Warning messages are repeated, followed by:
"Your Forum topic has been created."

As administrator, I don't get the warning messages.

I have not installed ACL or forum_access on this site. I have not enabled any privacy or access control, that I know of.

I'm working on the problem I posted at http://drupal.org/node/282929 (No Forums selection list, and Invalid argument supplied for foreach() og_forum).

I started a new site, hallman.nccommunities.org, running under the same software installation as nccommunities.org (which has the problems I reported earlier). Enabled forums, created container "General" with forum "General discussion."
http://hallman.nccommunities.org/node/add/forum/2 looks fine. Has General discussion in the Forums dropdown selection box.

Enabled organic groups and created a group.
http://hallman.nccommunities.org/forum looks good. http://hallman.nccommunities.org/node/add/forum/2 has dropdown selection box. Is good.

Enabled og_forum 5.x-2.x-dev
As an authenticated user, http://hallman.nccommunities.org/node/add/forum/2 now has:
* warning: reset() [function.reset]: Passed variable is not an array or object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1142.
* warning: key() [function.key]: Passed variable is not an array or object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1143.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1144.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1144.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1144.

I inserted some print statements in function og_forum_form_alter:
* form_id: search_theme_form
* form_id: forum_node_form
* $group:
* arg(0): node
* arg(1): add
* arg(2): forum
* arg(3): 2
* nid:
* $GID:

I can't get anything to print past
if ($GID) {

I don't know php and am having trouble following what happens after " if ($GID) {"

Judy Hallman

Comments

Anonymous’s picture

Assigned: Unassigned »

As i cannot reproduce this problem with the latest drupal core & og contributed module on a bare bones setup with my current working copy of OG Forum what i will do is release a development release of OG Forum later today and hopefully that will solve your problem and also fix a number of issues in our queue.

Paul

hallman’s picture

Using README.txt,v 1.5.2.1.2.7 2008/07/22 14:33:56 paulbooker

On this site, as an authenticated user
http://hallman.nccommunities.org/node/add/forum/2 gives
"warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/drupal/public_html/sites/all/modules/og_forum/og_forum.module on line 1270."

I got the same warning when I previewed and when I submitted.

hallman’s picture

Priority: Critical » Normal

Changing Priority to "normal." It works... It just gives a Warning message.

Anonymous’s picture

Status: Active » Fixed

Please reopen this issue if it is not resolved in the latest development snapshot.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

MaciejSchuttkowski’s picture

Version: 5.x-2.x-dev » 5.x-2.2
Status: Closed (fixed) » Needs review

Hi there!
I encountered the same problem in 5.x-2.2 ...
I have had my forums in containers once and as I removed them from their containers the warnings appeared.

After studiying the og_forum.module I've found that $all_results passed to array_key_exists on line 1275 was empty,
(i guess, because the forums don't have parents anymore)
so I added a check if $all_results is an array or object, now there are no more warnings.

// ...
          $option_key = key($the_rest->option);
          if (is_array($all_results) || is_object($all_results)) { // + ADDED on line 1214
            if (!array_key_exists($option_key, $all_results)) {
              unset($form['taxonomy'][$vid]['#options'][$key]);
            }
          } // + ADDED
// ...
          $option_key = key($the_rest->option);
          if (is_array($all_results) || is_object($all_results)) { // + ADDED on line 1275
            if (array_key_exists($option_key, $all_results)) {
              unset($form['taxonomy'][$vid]['#options'][$key]);
            }
          } // + ADDED

Would be glad to get some feedback if this fixes the Problem!
(sorry, but I don't know how to supply patches for now, so I give you the "raw" code)

Anonymous’s picture

Thanks for your help Maciej,

I'll look into this tomorow morning

Anonymous’s picture

Status: Needs review » Fixed

Thanks Maciej,

Ill get that fix committed late this week or early next week.

Anonymous’s picture

Status: Fixed » Closed (fixed)
MaciejSchuttkowski’s picture

I'm glad I could help out :)

kobnim’s picture

Version: 5.x-2.2 » 6.x-1.0

Hello,
I am experiencing the same problem with version 6.x-1.0. When I click "create forum topic" I get these errors:

    * warning: reset() [function.reset]: Passed variable is not an array or object in sites/all/modules/og_forum/og_forum.module on line 1260.
    * warning: next() [function.next]: Passed variable is not an array or object in sites/all/modules/og_forum/og_forum.module on line 1262.
    * warning: key() [function.key]: Passed variable is not an array or object in sites/all/modules/og_forum/og_forum.module on line 1263.


Thanks,
Mindy

kobnim’s picture

Category: support » bug
Status: Closed (fixed) » Active

Hi, sorry for the extra message. I am resetting "status" to "active" for the message above.

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

Would you provide a list of your contributed modules , thanks.

kobnim’s picture

Hi Paul
Here is a list of the contributed modules on my system, as you requested:

Administration:
---------------
administration menu

cck:
----
content
content copy
content permissions
content taxonomy
content taxonomy autocomplete
content taxonomy options
fieldgroup
filefield
imagefield
nodereference
number
option widgets
text

content profile:
---------------
content profile
content profile user registration

Development:
---------------
devel

Form Elements:
---------------
hierarchical select
hierarchical select menu
hierarchical select taxonomy

Image:
---------------
Image
Image FUpload

Imagecache:
---------------
imageapi
ImageapiGD2

Mail:
---------------
Block user messages
Private messages

Organic groups:
---------------
OG Block visibility
OG Content Type Admin
OG forum
OG user roles
OG
OG access control
OG groups actions
OG views integration
Subgroups for Organic groups

Other:
---------------
Advanced help
Advanced help example
Automatic nodetitles
Image FUpload
jquery UI
Lightbox2
Logintoboggan
Pathauto
Taxonomy Manager
Token
Token Actions

StatusBook:
---------------
corkboard
fans
friends
statusbook
statusbook event
statusbook photo
statusbook poke

Views
---------------
Views
Views exporter
Views UI

Thanks for looking into this!

- Mindy

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Active
Anonymous’s picture

Title: warning: reset() [function.reset]: Passed variable is not an array or object » [OG FORUM COMPATIBILITY ISSUES] warning: reset() [function.reset]: Passed variable is not an array or object
Version: 6.x-1.0 » 6.x-2.x-dev
Anonymous’s picture

Assigned: » Unassigned
Anonymous’s picture

Would you update this issue in the light of improved AF integration

http://drupal.org/node/386566

Anonymous’s picture

Status: Active » Closed (fixed)

Hello,

In order to make best use of our time and fix any compatibility issues still remaining would someone please see if there is still a problem here on the latest 6.x-2.x-dev branch and if there is still a problem report this a new bug using the following schema ..

Please format your bugs as follows ...

Description:
Blah Blah Blah

Repeatable: Always | Sometimes

Steps to repeat:

1. Blah Blah Blah
2. Blah Blah Blah
..

Expected Results:
Blah Blah Blah

Actual Results:
Blah Blah Blah

Detail & Proposed solution:
Blah Blah Blah