Project:Content Type Administration by Organic Group
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:rconstantine
Status:closed (fixed)

Issue Summary

Getting this error when I try to manage content types within a group

warning: Invalid argument supplied for foreach() in /home/cardboar/public_html/oursongs/modules/og_content_type_admin/og_content_type_admin.module on line 547.

Here's how I broke it. As an admin, I changed the name of the group. When I went into the OG content types section (of the admin) the new name change wasn't reflected in the group permission settings. I deleted the permission settings to the old name and then added the group back (the new name was selectable). Then when I went to the group and tried to manage content types there, I got the above error message.

Sal

Comments

#1

Um, first thing to check is what version you are running. The current version has line 547 as a blank line and the function it falls in doesn't make sense for your error message. The following function makes sense because that's where the group admin decides which content types to ACTIVATE. The 'foreach' in that function is in regards to the list from the database for that group which have been ALLOWED by the sys admin.

So, for the long term solution, I may need to create a sniffer function that looks for name changes to groups.

3) For your immediate solution, don't change group names; also if you can browse the database (phpmyadmin for example), go to the og_content_type_admin table, find the group id (gid) that corresponds to that group, make sure the name is correct, and if the types_allowed and types_active entries don't look like those for other gid's, then copy a set from another group into that group's. Then you should at least be able to work with this as normal.

2) And while you're in there, make sure there isn't a duplicate entry for this group.

1) One last thing, if you update your module to the latest version (dev), let me know what the line number is if it still crashes on you.

I put the numbers in after I wrote the above, but do them in the order as numbered.

#2

Version:5.x-1.0» 5.x-1.x-dev
Assigned to:Anonymous» rconstantine
Status:active» fixed

Fixed this just now. I have a couple more things to do, then I'll upload all of the changes.

#3

Status:fixed» closed (fixed)
nobody click here