When accessing content, the following errors are being reported when not logged in:

Invalid argument supplied for foreach() in ...\modules\filter.module on line 560.

which also results in the following error from 564:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR format = 3' at line 1 query: SELECT * FROM filter_formats WHERE OR format = 3
(it's being reported from include\database.mysql.inc but it's obvious where it's originating from)

the Anonymous user does have access to Access Content in access admin (as well as a few other permissions)

Comments

sangamreddi’s picture

I got the same error, form my investigations if only one filter is enabled i am seeing this error, if more than one filter eneabled then this error disappear.

Zen’s picture

Unable to reproduce. Please provide more information and if possible, accurate steps to reproduce this on a clean install.

Thanks
-K

gerhard killesreiter’s picture

Version: 4.7.0-beta6 » 4.7.0
Status: Active » Closed (fixed)

closing, no feedback

SolomonGifford’s picture

Version: 4.7.0 » 5.7
Status: Closed (fixed) » Active

I'm having this in 5.7 now.

Invalid argument supplied for foreach() in [....]modules/filter/filter.module on line 644.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR format = 1' at line 1 query: SELECT * FROM filter_formats WHERE OR format = 1 in [....]includes/database.mysql.inc on line 172.

bart jansens’s picture

Status: Active » Postponed (maintainer needs more info)

This is caused by $user->roles being empty, which should never happen. Probably the database is corrupt, or some other module is messing with the $user object.

- check the users table in the database. Is there a row with uid 0 in there?
- which other modules are you using?

SolomonGifford’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Thanks for the hint. I do have another auth module that we've written, so I bet thats where the problem is.

Thanks!