Been running Advanced Forums with Forum access for a while with success. But I went to try AF 6.2 Dev things seemed to work but my logs started filling up with
Invalid argument supplied for foreach() in /drupal-6.14/sites/all/modules/forum_access/forum_access.module on line 278
The offending area -
* Implementation of $modulename_preprocess_$hook() for forums.
*
* Remove 'post' links from forum page, if the user does not have the
* 'create' permission.
*/
function forum_access_preprocess_forums(&$variables) {
if (!forum_access_access($variables['tid'], 'create')) {
foreach ($variables['links'] as $key => $link) {
if (substr($link['href'], 0, 9) == 'node/add/') {
unset($variables['links'][$key]);The line it was complaining about -
foreach ($variables['links'] as $key => $link) {
I rebuilt permissions, deactivated then reactivated Forum Access, deactivated then reactivated Advanced Forum, cleared cache, etc. and still got flooded with this error.
After rebuilding permissions the errors were no longer kicked out for logged in users but anonymous hits are generating this error.
Someone else running 6.2 Alpha 2 of AF is also getting these errors
Comments
Comment #1
salvisPlease update Forum Access to version 1.1 before you post bug reports against that version.
CVS shows that this was fixed in v1.48 of the forum_access.module file on September 19. We're at
// $Id: forum_access.module,v 1.52 2009/11/20 23:25:30 salvis Exp $in 6.x-1.1.
Comment #2
marcus0263 commentedAaah I see new release just released today, I'll update and test again.
Thanks
Comment #3
salvisIt doesn't matter whether it was released only a minute ago.
If you mark your version as 6.x-1.1, then you better have that version, otherwise you're just wasting our time.
And, ideally, you'd check the issues queue to see whether the issue has already been reported, and the Notes on the -dev version to see whether it has already been fixed.
There are a couple thousand of known sites using FA, and I'm sure glad about each and every admin who can take care of his site by himself...
Comment #5
marcus0263 commentedI was able to finally upgrade, I deleted
/modules/forum_access, extracted the tarball, upgraded all is well.
Thanks for looking into it, deleting the module's dir then extracting and upgrading did the trick.
Cheers and thanks for an outstanding module
Comment #6
salvisThanks for letting us know.