Invalid argument supplied for foreach() when trying to removing myself
A bug in 2.1.1, submitted by sjoerdmulder on 07 October 2010
Announcement
Symphony's issue tracker has been moved to Github.
Issues are displayed here for reference only and cannot be created or edited.
Browse
Closed#412: Invalid argument supplied for foreach() when trying to removing myself
Although this bug is valid (and simple to fix), I’m more curious in the expected behaviour here.
Should you really be able to remove yourself?!
@sjoerdmulder, did you expect yourself to be removed? Or did you expect any error saying that you can’t remove yourself?
I think that not be able to remove yourself makes more sense.
This issue is closed.
Was trying out Symphony what the “Developer” role does, then tried to remove the developer user which i was currently when logged in.
Steps to reproduce:
Invalid argument supplied for foreach() /home/sjoerd/www/symphony/symphony/content/content.systemauthors.php line 112
107 ### 108 # Delegate: Delete 109 # Description: Prior to deleting an author. ID is provided. 110 //$ExtensionManager->notifyMembers(‘Delete’, getCurrentPage(), array(‘authorid’ => $authorid)); 111
112 foreach($checked as $authorid){ 113 $a = AuthorManager::fetchByID($authorid); 114 if(isobject($a) && $a->get(‘id’) != Administration::instance()->Author->get(‘id’)) AuthorManager::delete($authorid); 115 } 116