Well : I setup a view with one argument (I have tried either with vocabulary term or node id).
If I select : default page not found, everything is ok
If I select : use empty text, I have the following error :
user warning: 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 'LEFT JOIN i18n_node i18n ON node.nid = i18n.nid WHERE (i18n.language ='fr' OR i' at line 1 query: pager_query LEFT JOIN i18n_node i18n ON node.nid = i18n.nid WHERE (i18n.language ='fr' OR i18n.language ='' OR i18n.language IS NULL) in /opt/www/htdocs/Drupal2/includes/database.mysql.inc on line 173.
It seems that in the views_build_view the call to
$query = db_rewrite_sql($info['query'], 'node');
when $info['query] is empty, does not return an empyt query.
I have just added a test :
if ($info['query']) {
$query = db_rewrite_sql($info['query'], 'node');
}
Well I guess that this is really a db_rewrite_sql problem which should NOT return bad queries :)
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | views.module-empty text from arguments.patch | 460 bytes | abautu |
Comments
Comment #1
mx16 commentedThanks, it realy helped! I had similar problem, except warnings were not shown when I was logged in as first (and only) user.
Comment #2
halfiranian commentedI have exactly the same problem as mx16 and goudal
I'm filtering a view (with organic groups) and when I ask it to use 'empty text' it gives the above SQL error.
It doesn't give the warnings when logged in as first user.
How exactly do you fix this?
Cheers
Comment #3
halfiranian commentedcheers, just changed this is views.module
will this be incorporated into the next release?
Comment #4
sunThere's no patch that could be included in the next release yet.
Comment #5
abautu commentedThis is caused by using Use Empty text in an argument. Because of this happens, the $info['query'] is empty. Views does not test for it and simply calls the db_rewrite_sql functions which generates half a query. This happens only when you have modules that rewrite queries enabled (line i18n and node access control).
I attached a patched to fix this.
Comment #6
esmerel commentedI doubt that any changes will get committed, but if they are, this is marked for review.
Comment #7
abautu commentedFixed by 1.7.