Error on Edit Permissions after removing some groups
pospues
Joined: 2004-12-28
Posts: 31 |
Posted: Wed, 2004-12-29 16:44 |
I was setting up a new Gallery 2 installation with groups assigned to various members. For another reason, I then deleted the groups and members and recreated new ones. After doing this, I now receive this error at the top of the Edit Permissions page for any album or photo: Warning: Invalid argument supplied for foreach() in /vol1/pospues/gallery2/modules/core/ItemPermissions.inc on line 38 I expect you'll need more information from me. I'll create an account for you to access the system if that will help. Also, if I try to remove a permission, I receive this error (I don't know if this is related or not, but I did definitely have permissions before I started getting these errors): The action you attempted is not permitted. ----
|
|
Posts: 8601
if you can determine the steps to reproduce this error from a clean install it would be very helpful. also, is line 38 the right line in ItemPermissions.inc? looks like it should be 368 or 381 ?
do all items still show "All access" permission for site admins group?
Posts: 31
Yes, it was indeed line 381, sorry for the Copy Paste issue. On the permissions page, the Group Permissions section does not actually show the name of any of the Groups. What I see is:
[core] View item [core] View item
[core] View resized version(s) [core] View resized version(s)
[core] View original version [core] View original version
[core] Add sub-album [core] Add sub-album
[core] Add sub-album [core] Add sub-album
[core] Add sub-album [core] Add sub-album
[core] Add sub-item [core] Add sub-item
All access
I'll see if I can reproduce this on a clean install.
Posts: 31
To reproduce this: Create a new Group named 'Placeholder'. Assign 'Placeholder' permission to 'Add Sub-Album' on one of my Albums. Delete Group named 'Placeholder'. Returned back to Edit Permissions on my Album. Received ERROR_MISSING_OBJECT (once I updated it with the return code checking as mentioned below).
So I have verified that it is indeed an issue with a permission remaining still pointing to a non-existent group. First, I think it would have been easier for me to track the failure if the result validation code had been present after loadEntitiesById(array_keys($userAndGroupEntityIds))... (the standard if ($ret->isError())...
To recover from this, I manually recreated the group with the former ID in the MySQL database and was able to remove those obsolete permissions from each album I had used that group before finally removing the group itself.
Posts: 31
I've logged this as bug req# 1093335
Posts: 8601
nice work, pospues.. glad you have the technical ability to resolve the problem on your site until we get this fixed!
Posts: 8601
fix committed to cvs.