When the default setting for an argument is "Use empty text", any user who does not have administer nodes permission and loads the view without the argument will get an SQL error. This is because db_rewrite_sql() adds join and where clauses even to empty queries.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | views.module-205390.patch | 598 bytes | darren oh |
| #1 | views.module-205390.patch | 590 bytes | darren oh |
Comments
Comment #1
darren ohThe attached patch adds a test for empty queries.
Comment #2
digikami commentedshould probably be
Comment #3
darren ohGood catch.
Comment #4
catchBumping priority since there's a few duplicates around.
Comment #5
dropcube commentedIf a module that rewrites queries is installed and an empty query is generated by
_views_get_queryand error is caused due todb_rewrite_sql()generates an incorrect query.The above patch fixes the issue.
Comment #6
suit4 commentedPatch views.module-205390.patch works for me, too.
Comment #7
bwong commentedI found this the hard way, using the Trace module. This patch works for me.
Comment #8
sunThis was already fixed in #247420: SQL error when using empty text as argument default and #217015: Views module sends null query when building a block, and has been committed.
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.