If Views module intalled, the tracker (/drupal/?q=tracker) properly shows all recent content, but also shows this error:
You have an error in your SQL syntax near 'ON arg.vid=view.vid WHERE arg.type IN ('') AND view.page_type='date_views_browse' at line 1 query: SELECT arg.*, view.name FROM view_argument arg JOIN view_view view ON arg.vid=view.vid WHERE arg.type IN ('') AND view.page_type='date_views_browser' in file drupal/includes/database.mysql.inc at line 120
After uninstalling Views, error disappears.
Tested on Drupal 4.7.3 and 4.7.4, PHP 5.1.2, MySQL 3.23.58.
Other modules installed: og, event, tracker and some more
Comments
Comment #1
merlinofchaos commentedSELECT arg.*, view.name FROM view_argument arg JOIN view_view view ON arg.vid=view.vid WHERE arg.type IN ('') AND view.page_type='date_views_browser'
This is really odd.
That query is working on a views table, but that query does not appear in Views. For one, nowhere in Views do I use a JOIN without qualifying it with either LEFT or INNER; for two, 'date_views_browser' is not a default view type.
I think you have some other module that utilizes Views that is causing this problem.
A quick grep through contrib shows that the module 'date' for CCK is the source of the errant query:
Sending this over there.
Comment #2
mgrafi commentedThanks, you were right. After disabling the date module no error occured.
Comment #3
karens commentedI haven't been able to replicate this. I need to know a couple things.
Did you have any date views set up, like Date Browser? If so, do you have a block view showing on the page you are having trouble with? If so, that view is the culprit, and I need an export of the view to see how it is set up.
Also, double-check your setup of the tracker view when you re-enable the Date module. There is an option for a Date: Browser plugin which ends up being the first option in the list. If that got selected somehow instead of the table view, it would produce strange results like you describe, and it would go away if you disable the Date module because that plugin would no longer be available.
Comment #4
foxtrotcharlie commentedI also am getting this error, but it's not on the tracker page, but is being show on the pages where I have my views blocks. If I disable the date module, the problem goes away. If I disable the views blocks that I have on these pages, it also goes away. Here is an export of one of my views:
Cheers,
Charles.
Comment #5
karens commentedUpdate to the latest version of views, pull up your view and make sure that Page type is not set to Date:Browser, and save the view and that should fix it.
Your export shows that there is no page_type defined and in earlier versions of Views the Date: Browser would end up at the top of the page type list and thus be chosen as the page type by default when you save the view. That has been fixed in latest views which puts the normal views page types at the top of the list. You will need to pull up and save your view to be sure it wasn't previously saved with the wrong option.
Reopen if that doesn't do it.
Comment #6
pulpzebra commentedThe problem is caused on date_views.inc file as the
SELECT arg.*, view.name FROM tribunali_view_argument arg JOIN tribunali_view_view view ON arg.vid=view.vid WHERE arg.type IN ('') AND view.page_type='date_views_browser'SQL code doesn't provide a valid JOIN specification. At least, this is not working under mysql 3.23.
Comment #7
karens commentedYou won't get that SQL if you don't have the date browser selected as the page type. Did you try what I suggested above?
Comment #8
karens commentedI did need to add a test for whether you were trying to do a page or block view, which is in the latest commit. But you still need to fix your view so it does not have Date:Browser selected for the page type, just in case you every want to enable a page view.
Comment #9
foxtrotcharlie commentedThanks KarenS and pulpzebra. I initially couldn't find where to change the page view type (I know, really stupid...). Found it under the Page link on the view edit screen, and changed it, but it still didn't help. ALso, I'm not displaying as a page, but as a block - and the block view type is "Teaser List". I think I'll try upgrading to the latest views module and see if this sorts it out. I'm also not sure what version of MySQL the host is using, but I suspect it could be 3.23.... so that could be the problem?
Cheers.
Comment #10
karens commentedThe problem is not your mysql version, but I think I see now a situation where you would get this error. Update to the latest version of the date module which I think will fix it.
Comment #11
pulpzebra commentedso many posts...
well. the execution of the sql code above in phpmyadmin issued a syntax error. Don't know if in the meantime you updated the date module, but yes, I was running the latest date and views module (downloaded ab. 1 hour and a half ago).
However I think that mysql version DOES matter: here is what reported from mysql manual
Note that INNER JOIN syntax allows a join_condition only from MySQL 3.23.17 on. The same is true for JOIN and CROSS JOIN only as of MySQL 4.0.11.
Since I am on mysql 3.23 (... hope to upgrade as soon as possible!... ) a JOIN statement without condition should issue a syntax error.
Comment #12
karens commentedThe reason I said the version did not matter is that the sql in the example would be invalid in any version. And yes, I made a fix when I made that last post, so you need to pick up the latest version of the date module.
Comment #13
pulpzebra commentedIt actually works on mysql 4.1.x
but ok, backporting is always appreciated.
Thanks Karen for keeping your work always up to date!
Comment #14
pulpzebra commented--- Karen
I'm sorry to report that the new date_views.inc
$Id: date_views.inc,v 1.6.2.12 2006/11/15 16:23:25 karens Exp $
doesn't seem to correct the problem. It still runs the bad sql code
Comment #15
(not verified) commentedComment #16
suydam commentedI still get this problem.
Upgraded to the newest views, cck, date.module and even contemplate (just in case) :)
I've figured out how to fix it (maybe). I'm hoping one of you can shed more light on this.
I too am running mysql 3.23
OLD CODE (dumps the aforementioned error):
NEW CODE (doesn't dump the error, appears to work, emphasized diff)
Not being a SQL expert, I'm unclear if this is going to alter the behavior of my views, but I think it should be ok.
Comment #17
suydam commentedoops, forgot to change status.
Comment #18
kmv commentedI too am getting this in 5.x RC1, I have the latest version of Views and the latest version of Date. I am on MySQL v3.23.56
Comment #19
kmv commented@KarenS
I forgot to point out that i DID check the View Type on the tracker view, and it was set to "Table View".
Comment #20
karens commentedI don't have a MYSQL 3 installation to test on, but if I get some confirmation that changing JOIN to INNER JOIN fixes the problem, I'll commit the change.
Comment #21
kmv commentedI can confirm that this works for me.
Comment #22
karens commentedFix committed to all branches. Thanks everyone!
Comment #23
karens commentedComment #24
(not verified) commented