warning: key() [function.key]: Passed variable is not an array or object in /home/shushuor/public_html/sugardave.com/drupal/modules/og_forum/og_forum.module on line 673.
Similar error message to http://drupal.org/node/107378, except mine is in og_forum.module
I see this in og-5.x-3.1 with og_forum-5.x-2.0 and og-5.x-3.x-dev with og_forum-5.x-2.x-dev.
Comments
Comment #1
sugardave commentedwarning: implode() [function.implode]: Bad arguments. in /home/shushuor/public_html/sugardave.com/drupal/modules/og/og.module on line 1758.Currently using the dev releases, I figured I would see what would happen if there was already a forum topic posted for that group (forum was empty when receiving the bug).
I went to the forums directly and attempted to post a topic in the target forum and received the error above and the following message said it had created my forum topic, and it did create it. The original error (passed variable not an array/object) still occurs when attempting to post a topic from the group details block regardless if the forum is empty or not.
Interestingly, on another site where I have the current (non-dev) releases of og and og_forum, I can post directly into the group's forum without this error (bad arguments to implode() function) appearing.
It may be something I have screwed up, since I am very new to Drupal.
Comment #2
sugardave commentedStill using the dev modules:
I installed the OG Content Type Administration module, thinking that I could at least avoid users seeing the issue if they couldn't post topics from the group details block. I turned everything off so a group member would only see the minimum set of links. I accessed the group forum from the block and attempted to respond to the test topic I have in there, and the response was posted, but I received this error when I submitted it:
Just did a quick check on the other site with current release (non-dev) og and og_forums: added content administration, performed same test and did not receive this huge error. So, that's a plus for me, looks like I can hide the error from users, but still would like to see this fixed.
Comment #3
sugardave commentedOkay, this is probably something I did. I installed a fresh Drupal today with non-dev og* modules I'm using and don't see this problem. I think it's a combination of TAC and too many late nights.
Comment #4
phayes commentedI ran into this same issue. on both the dev version and the stable release.
The problem is that on line 712 it is being passed a string "- Please Choose -". Normally it expects to see objects or arrays, but this string just confuzzles it.
So, just wrap the code inside the foreach with this:
So you get something that looks like
This isn't a perfect solution since we somehow keep the "- Please Select - "... hrm.. but it will stop the errors from happening.
Comment #5
rconstantine commentedDude, you didn't even bother looking at the existing issues it seems. It's not like there are 10+ pages of issues like with CCK or OG. This was even marked as solved and ready to be committed: http://drupal.org/node/206064
Next time, do a little reading please.
Oh, and don't get me wrong, I do appreciate issue posts. But duplicate work I don't enjoy.