[wp-trac] [WordPress Trac] #57767: SQL query error with multiple order specifications in pre_get_posts.

WordPress Trac noreply at wordpress.org
Mon Feb 20 03:09:37 UTC 2023


#57767: SQL query error with multiple order specifications in pre_get_posts.
--------------------------+-----------------------------
 Reporter:  kuroro111     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  6.1.1
 Severity:  critical      |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 https://onl.sc/bW7VqVx

 We have started a thread in the above forum but have not been able to
 resolve the issue.

 You can refer to the URL for more details, but when I specify multiple
 sorting conditions based on the value of a custom field, the results are
 not displayed properly, and when I throw the query portion of the request
 in $query directly to SQL in the hook point of pre_get_posts, the
 following error is returned The following error is returned.


 {{{
 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains
 non-aggregated column 'local.wp_postmeta.meta_value' which is not
 functionally dependent on columns in the GROUP BY clause; this is
 incompatible with sql_mode=only_full_group_by
 }}}

 {{{

 }}}


 Is this part of a bug?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57767>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list