I'm getting the following errors on a fresh install of Drupal 7 Alpha2, Views 7--3. I have enabled the tracker view and created a basic article page. I'm running on PostgreSQL 8.4, and XAMPP 1.6.8; Apache 2.2.9, PHP 5.2.6.
It doesn't look like the query's placeholders are being replaced with the array of arguments.
I'm getting this error at: example.com/tracker
PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: ":user-current-user": SELECT node.type AS node_type, node.title AS node_title, node.nid AS nid, 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, history.timestamp AS history_timestamp, node.created AS node_created, node.changed AS node_changed FROM {node} node INNER JOIN {users} users ON node.uid = users.uid INNER JOIN {node_comment_statistics} node_comment_statistics ON node.nid = node_comment_statistics.nid LEFT OUTER JOIN {history} history ON node.nid = history.nid AND history.uid = :views_join_condition_0 WHERE (( (node.status <> :db_condition_placeholder_1) )) ORDER BY node_comment_statistics_last_comment_timestamp DESC; Array ( [:db_condition_placeholder_1] => 0 [:views_join_condition_0] => :user-current-user ) in views_plugin_pager->execute_count_query() (line 127 of htdocs\d7\sites\all\modules\views-DRUPAL-7--3\plugins\views_plugin_pager.inc).
I'm getting this error at: example.com/comments/recent
# Debug: 'Exception: SQLSTATE[42703]: Undefined column: 7 ERROR: column comment.comment does not exist LINE 1: ..., comment.cid AS cid, comment.nid AS comment_nid, comment.co... ^' in views_plugin_query_default->execute() (line 1137 of htdocs\d7\sites\all\modules\views-DRUPAL-7--3\plugins\views_plugin_query_default.inc).
# Debug: 'SELECT node_comment.title AS node_comment_title, node_comment.nid AS node_comment_nid, comment.changed AS comment_changed, comment.subject AS comment_subject, comment.cid AS cid, comment.nid AS comment_nid, comment.comment AS comment_comment, comment.format AS comment_format FROM {comment} comment LEFT OUTER JOIN {node} node_comment ON comment.nid = node_comment.nid WHERE (( (node_comment.status <> 0 OR (node_comment.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0) OR ***ADMINISTER_NODES*** = 1 = :db_condition_placeholder_0) )) ORDER BY comment_changed DESC LIMIT 5 OFFSET 0' in views_plugin_query_default->execute() (line 1144 of htdocs\d7\sites\all\modules\views-DRUPAL-7--3\plugins\views_plugin_query_default.inc).
The live preview of these views throw the same errors.
Let me know if I you need any more details.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | screenshot2.png | 50.99 KB | dawehner |
Comments
Comment #1
dawehnerThe tracker view shouldn't fail. Can you update to the latest dev version, please?
The comment recent view, is currently only possible if you remove (Node) Node: Published or admin and replace it with node: published.
Comment #2
bendiy commentedI just grabbed this version today and I'm still getting the same error on the tracker view:
Do I have the cvs tag right for the dev version?
Comment #3
bendiy commentedI'm able to reproduce this on a different system.
Steps to reproduce:
Comment #4
dawehnerAre you really sure, you use the CVS version?
Here it works fine
Its a new d7 version.
Comment #5
bendiy commentedI just tried it on MySQL and it's working. This appears to be a PostgreSQL issue in core.
I think they are working on it here:
Hopefully that will fix it.
Comment #6
damien tournoud commentedNope. Views has to do proper type casting if required. An integer is an integer, try passing a string instead, and PostgreSQL will bomb.
Comment #7
josh waihi commentedMySQL is very forgiving and will consider '12' to be 12 when used on a integer column much like how PHP will let you add '12' and 13 together (a string and a integer). PostgreSQL on the other thinks that if you are trying to pass a string to an integer column, no matter what the value, something is wrong in your code. Rather than risking data corruption, PostgreSQL will error.
So like Damian said, Views will need to type cast integers if they are strings.
Comment #8
dawehnermhhh
Comment #9
dawehner@jash waihi
Could you describe what's wrong here?
Comment #10
dawehnerThis is fixed now in the latest dev. yeaaaaaah.
Comment #11
bendiy commentedyeaaaaah!
Thanks for your help.
Comment #13
liam morlandTagging