Currently, if a page has index_order_by_classifier set, and one or more of its live children have more than one ClassifierTerm under that classifier set, Django will return a programming error more than one row returned by a subquery used as an expression.
This makes sense, as it is trying to sort on an order that is non deterministic. To fix, we slice the queryset to only ever contain a single term, which should also always be the highest order term due to the default ordering for the classifier terms.
Description of change
Currently, if a page has
index_order_by_classifier
set, and one or more of its live children have more than oneClassifierTerm
under that classifier set, Django will return a programming errormore than one row returned by a subquery used as an expression
.This makes sense, as it is trying to sort on an order that is non deterministic. To fix, we slice the queryset to only ever contain a single term, which should also always be the highest order term due to the default ordering for the classifier terms.