When i add the field 'Has new content' to my view, i get 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 '***CURRENT_USER*** ) GROUP BY n.nid ASC ORDER BY score DESC' at line 3 query: CREATE TEMPORARY TABLE temp_faceted_search_results_1 (nid int unsigned NOT NULL, PRIMARY KEY (nid)) Engine=HEAP SELECT n.nid AS nid, 5 * POW(2, (GREATEST(MAX(n.created), MAX(n.changed), MAX(c.last_comment_timestamp)) - 1239116832) * 6.43e-8) + 5 * (2.0 - 2.0 / (1.0 + MAX(c.comment_count) * 1)) AS score FROM node AS n LEFT JOIN node_comment_statistics AS c ON n.nid = c.nid WHERE n.nid IN (SELECT node.nid AS nid FROM node node LEFT JOIN history history_user ON node.nid = history_user.nid AND history_user.uid = ***CURRENT_USER*** ) GROUP BY n.nid ASC ORDER BY score DESC in C:\xampp\htdocs\testcase\sites\all\modules\faceted_search\faceted_search.inc on line 1174.

The problem is ***CURRENT_USER*** that wasn't replaced when it isn't in view_args. Following fixed it:
foreach($views_replacements as $holder => $replacement) {
$views_query = str_replace($holder, $replacement, $views_query);
}

Comments

David Lesieur’s picture

Priority: Normal » Critical
Status: Active » Needs review
David Lesieur’s picture

Status: Needs review » Fixed

Fix committed (with slight change to avoid the foreach loop). Thanks!

Status: Fixed » Closed (fixed)

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