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.

CommentFileSizeAuthor
#4 screenshot2.png50.99 KBdawehner

Comments

dawehner’s picture

The 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.

bendiy’s picture

I just grabbed this version today and I'm still getting the same error on the tracker view:

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d views-DRUPAL-7--3 -r DRUPAL-7--3 contributions/modules/views/

Do I have the cvs tag right for the dev version?

bendiy’s picture

I'm able to reproduce this on a different system.
Steps to reproduce:

  1. Install Drupal 7 Alpha2
  2. Install Views 7.x-3.x-dev
  3. Create new test Article node
  4. Enable "tracker" view
  5. Edit "tracker" view
  6. Click "Preview" for live preview in on the edit screen
  7. OR visit tracker view url
dawehner’s picture

StatusFileSize
new50.99 KB

Are you really sure, you use the CVS version?

Here it works fine

Its a new d7 version.

bendiy’s picture

Status: Active » Closed (duplicate)
Issue tags: +PostgreSQL

I 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.

damien tournoud’s picture

Status: Closed (duplicate) » Active

Nope. Views has to do proper type casting if required. An integer is an integer, try passing a string instead, and PostgreSQL will bomb.

josh waihi’s picture

MySQL 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.

dawehner’s picture

mhhh


  return array(':user-current-user' => intval($user->uid));

dawehner’s picture

@jash waihi

Could you describe what's wrong here?

dawehner’s picture

Status: Active » Fixed

This is fixed now in the latest dev. yeaaaaaah.

bendiy’s picture

yeaaaaah!

Thanks for your help.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

liam morland’s picture

Tagging