I'm receiving the following error when viewing a node that is eligible to be in a nodequeue:

PDOException: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Column 'nodequeue_subqueue.qid' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.: SELECT s.*, COUNT(n.position) AS count, s.sqid AS _field_0 FROM {nodequeue_subqueue} s LEFT OUTER JOIN {nodequeue_nodes} n ON n.sqid = s.sqid WHERE ( (( ([s].[qid] = :db_condition_placeholder_0) AND ([s].[reference] IN (:db_condition_placeholder_1)) )) ) GROUP BY s.sqid; Array ( [:db_condition_placeholder_0] => 5 [:db_condition_placeholder_1] => 5 ) in nodequeue_load_subqueues_by_reference() (line 794 of C:\development\fas\docroot\sites\all\modules\contrib\nodequeue\nodequeue.module).

This is due to the stricter requirements SQL Server has for GROUP BY clauses. Patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

azinck’s picture

Patch attached. We could alternatively solve this using subqueries but I think this patch is a bit simpler.

azinck’s picture

Status: Active » Needs review
azinck’s picture

tbaumgard’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

I'm not sure that adding code specifically for SQL Server, or any other database software for that matter, should be added to this module. Something like that probably belongs in the database abstraction layer instead. However, I thought I'd confirm for those who have no other option that this patch makes Nodequeue (at least up to 7.x-2.1) work with SQL Server.

  • jenlampton committed e27f1a7 on 7.x-2.x authored by azinck
    Issue #1992262 by azinck: SQL Server aggregate function compatibility
    
jenlampton’s picture

Status: Reviewed & tested by the community » Fixed

Merged into 7.x-2.x.

Status: Fixed » Closed (fixed)

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