The nodequeue_load_subqueues_by_reference seems to be constructing an invalid where clause if there are more than one references passed in.

In the case where there is only one reference the where clause is built correctly => "where s.qid = :qid AND s.reference in (:reference)", and the bind variables are correctly applied. When there a multiple references the additional "OR" clauses are appended but the where clause set on the $query object is done every iteration with the bind variable names not changing. That means the last call to $query->where sets the final where clause and applies the variables used in the final call for "all" the bind variables designated in the query. Long story short... the bind variable names used to build the query need to be unique if the incoming variable parameters are not the same.

Ugggh... I hope someone can make sense of that :(

I've attached a patch that seems to work for us.

Comments

merlinofchaos’s picture

Status: Active » Closed (duplicate)