When editing the standard built in view and hit save (without changing anything) i get this:
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 737.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 739.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 741.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 743.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 745.
* 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 'sql, countsql) VALUES ('6', '1135093331', 'tracker/tracker', 'Shows all new acti' at line 1 query: INSERT INTO view_view (vid, changed, name, description, type, title, header, header_format, block, nodes_per_block, block_display_header, block_more, url, menu_title, use_pager, nodes_per_page, sql, countsql) VALUES ('6', '1135093331', 'tracker/tracker', 'Shows all new activity on system.', '2', 'recent posts for %1', '', '1', '1', '10', '0', '0', '3', 'recent posts', '1', '25', '', '') in C:\sites\drupal\includes\database.mysql.inc on line 116.
When accessing the standard built in view on mysite.com/index.php?q=views/tracker/tracker i'm getting:
* 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 '\node_comment_statistics node_comment_statistics ON n.nid = node_comment_statist' at line 1 query: SELECT count(*) as numrecs FROM node n LEFT JOIN \node_comment_statistics node_comment_statistics ON n.nid = node_comment_statistics.nid LEFT JOIN \users users ON n.uid = users.uid WHERE n.status = '1' ORDER BY node_comment_statistics.last_comment_timestamp DESC in C:\sites\drupal\includes\database.mysql.inc on line 116.
* 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 '\node_comment_statistics node_comment_statistics ON n.nid = node_comment_statist' at line 1 query: SELECT n.nid, n.type AS n_type, n.title AS n_title, n.changed AS n_changed, users.name AS users_name, users.uid AS users_uid, node_comment_statistics.comment_count AS node_comment_statistics_comment_count, node_comment_statistics.last_comment_timestamp AS node_comment_statistics_last_comment_timestamp FROM node n LEFT JOIN \node_comment_statistics node_comment_statistics ON n.nid = node_comment_statistics.nid LEFT JOIN \users users ON n.uid = users.uid WHERE n.status = '1' ORDER BY node_comment_statistics.last_comment_timestamp DESC LIMIT 0, 25 in C:\sites\drupal\includes\database.mysql.inc on line 116.
My database.mysql.inc Line 116 is: trigger_error(check_plain(mysql_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
I'm running: php5, mysql5, iis, the view moduled is from today.
Comments
Comment #1
merlinofchaos commentedYou're running into an unfortunate problem in that I inadvertantly named one of the table fields a SQL reserved word, which is a nono and I should have thought about that. But I did not.
If you're familiar with coding, the short term fix is this:
Do an alter table to rename the 'sql' field to something else, like 'sqlstr' or 'query' (uh, which may also be reserved so I'll have to actually look it up to see).
Then hack _views_view_fields() to change SQL to what you renamed it to.
Then hack _views_save_view and _views_load_view to set $view->sql to the database field before saving and set the database field to $views->sql after loading.
I can respect not wanting to go through all this; it will likely only be a few days before I get this bug fixed and checked in. (The fix will rename the field throughout the code, which is a little more involved but is the Right Way To Do It.)
Comment #2
merlinofchaos commentedComment #3
merlinofchaos commentedThis is a dup of http://drupal.org/node/41570.
Comment #4
merlinofchaos commentedJust so you get pinged; I fixed this ahead of schedule. It's in HEAD.
Comment #5
majomajomajo commentedThank you !
Felling kind of dumb asking this but i what is head version? I thought it ment last version but the bug is still there :)
Comment #6
merlinofchaos commentedIt does mean last version; the auto-packager is sometimes slow to pick it up though. The easiest way to tell is to look at views.module and see if there is a field named 'sql'; if it's still there, you have an older version.
The other problem is that you'll have to either drop your table or rename the columns.
If I remember right (I hope I do)
alter table view_view modify 'sql' query longtext;
alter table view_view modify 'countsql' countquery longtext;
Comment #7
merlinofchaos commentedDoh! Somehow I failed to check this in. I'm really sorry. I should've doublechecked before I said I had.
It's really in HEAD now.
Comment #8
majomajomajo commentedThank you, but the above issue is still there.
I've have the code from today, i've recreated the sql tables.
Note: i have comments activated.
Comment #9
majomajomajo commentedNote 2:
When viewing the views/frontpage everything is ok.
Note 3:
In the last post i sad that the issue is still there, by that i ment the error below:
* 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 '\node_comment_statistics node_comment_statistics ON n.nid = node_comment_statist' at line 1 query: SELECT count(*) as numrecs FROM node n LEFT JOIN \node_comment_statistics node_comment_statistics ON n.nid = node_comment_statistics.nid LEFT JOIN \users users ON n.uid = users.uid WHERE n.status = '1' ORDER BY node_comment_statistics.last_comment_timestamp DESC in C:\sites\drupal\includes\database.mysql.inc on line 116.
* 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 '\node_comment_statistics node_comment_statistics ON n.nid = node_comment_statist' at line 1 query: SELECT n.nid, n.type AS n_type, n.title AS n_title, n.changed AS n_changed, users.name AS users_name, users.uid AS users_uid, node_comment_statistics.comment_count AS node_comment_statistics_comment_count, node_comment_statistics.last_comment_timestamp AS node_comment_statistics_last_comment_timestamp FROM node n LEFT JOIN \node_comment_statistics node_comment_statistics ON n.nid = node_comment_statistics.nid LEFT JOIN \users users ON n.uid = users.uid WHERE n.status = '1' ORDER BY node_comment_statistics.last_comment_timestamp DESC LIMIT 0, 25 in C:\sites\drupal\includes\database.mysql.inc on line 116.
When editing the standard built in view and hit save i'm now getting:
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 917.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 919.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 921.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 923.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 925.
* user warning: Out of range value adjusted for column 'pid' at row 1 query: INSERT INTO menu (mid, pid, path, title, description, weight, type) VALUES (68, -183, 'views/tracker/tracker', 'recent posts', '', 0, 22) in C:\sites\drupal\includes\database.mysql.inc on line 107.
* user warning: Out of range value adjusted for column 'pid' at row 1 query: INSERT INTO menu (mid, pid, path, title, description, weight, type) VALUES (69, -183, 'views/tracker/trackerd', 'recent posts', '', 0, 22) in C:\sites\drupal\includes\database.mysql.inc on line 107.
Comment #10
majomajomajo commentedI think some of this errors is because i'm running Mysql 5.0.16 in strict mode:
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
Which is default in Mysql 5 + Windows i think.
Comment #11
merlinofchaos commentedHmm. What PHP version are you running? It looks like your version is translating a string slightly differently than mine.
I've committed something I think will fix that (a href="http://cvs.drupal.org/viewcvs/*checkout*/drupal/contributions/modules/vi...">here. I'm not sure what to do about the menu problem you're running into there, though. That might be a Drupal bug but it seems kind of strange. I again think that may be related to your PHP version (or your MySQL version).
Comment #12
merlinofchaos commentedThe above link had a broken commit. I feel stupid for it.
get 1.36 instead
Comment #13
merlinofchaos commentedI'm pretty sure I've fixed this error now.
Comment #14
majomajomajo commentedI'm running PHP 5.1.1, Mysql 5.0.16 and View 1.4.3.
What php-version are you using?
Now i can view both Frontpage and Tracker, but when editing any of them and hit save i get errors, for example when saving Frontpage i get:
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 733.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 736.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 739.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 742.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 745.
* warning: Attempt to assign property of non-object in C:\sites\drupal\modules\views\views.module on line 748.
* user warning: Field 'page_header_format' doesn't have a default value query: INSERT INTO view_view (vid, changed, name, access, description, page, url, page_type, page_title, use_pager, breadcrumb_no_home, nodes_per_page, menu, menu_tab, menu_tab_default, menu_tab_weight, menu_title, page_header, block, block_type, block_title, nodes_per_block, block_more, block_use_page_header, block_header, block_header_format, query, countquery) VALUES ('18', '1136371033', 'frontpage', '', 'The basic front page view.', '1', 'frontpage', 'teaser', '', '1', '1', '10', '0', '0', '0', '', '', '', '0', 'list', '', '', '0', '0', '', '1', 'SELECT node.nid FROM node WHERE (node.promote = \'1\') AND (node.status = \'1\') ORDER BY node.sticky DESC, node.created DESC', 'SELECT count(*) AS numrecs FROM node WHERE (node.promote = \'1\') AND (node.status = \'1\') ORDER BY node.sticky DESC, node.created DESC') in C:\sites\drupal\includes\database.mysql.inc on line 116.
Comment #15
merlinofchaos commentedI'm running PHP 4.1.9 which doesn't complain about either of these things.
The warnings are a nuisance; the MySQL error is actually a bug which you conveniently found for me, and I thank you.
I believe I have both of these fixed.
(BTW, if it turns out I haven't--and I can't say I'm completely confident that you won't find more--be sure to set the 'status' of this issue back to 'active').
Comment #16
majomajomajo commentedHehe, the only error now is when saving any of the builtin views. When saving the tracker view i get:
user warning: Out of range value adjusted for column 'menu_tab_weight' at row 1 query: INSERT INTO view_view (vid, changed, name, access, description, page, url, page_type, page_title, use_pager, breadcrumb_no_home, nodes_per_page, menu, menu_tab, menu_tab_default, menu_tab_weight, menu_title, page_header, page_header_format, block, block_type, block_title, nodes_per_block, block_more, block_use_page_header, block_header, block_header_format, query, countquery) VALUES ('21', '1136799854', 'tracker', '', 'Shows all new activity on system.', '1', 'tracker', 'table', 'recent posts for %1', '1', '0', '25', '1', '0', '0', '', 'recent posts', '', '1', '0', 'list', '', '', '0', '0', '', '1', '', '') in C:\sites\drupal\includes\database.mysql.inc on line 116.
Comment #17
majomajomajo commentedI downgraded to mysql 4.1.16 and the above issue went away. Thank you very much for taking your time, i really appreciate it.
Comment #18
dries commented