[wp-trac] [WordPress Trac] #18707: Meta Query printing "array" in query whwn compara type is LIKE

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 19 17:17:49 UTC 2011


#18707: Meta Query printing "array" in query whwn compara type is LIKE
--------------------------+-----------------------------
 Reporter:  tplayer       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  3.2.1
 Severity:  normal        |   Keywords:  needs-patch
--------------------------+-----------------------------
 Always a try to filter post by meta_query using a array value and compare
 equals to "LIKE" the returned SQL query is buged. WordPress return
 something like this:


 {{{
 (wp_postmeta.meta_key = 'passed_key_value' AND CAST(wp_postmeta.meta_value
 AS CHAR) LIKE '%Array%'))
 }}}

 The array values are not serialized, and "Array" are outputed to in SQL
 Query.

 Serializing the values the problem still the same and WordPress output in
 query somethinhg like this
 {{{
 (wp_postmeta.meta_key = 'passed_key_value' AND CAST(wp_postmeta.meta_value
 AS CHAR) LIKE '%Array[0], Array[1], Array[2]%'))
 }}}

 According the [http://codex.wordpress.org/Class_Reference/WP_Query
 WP_Query documentation], array is supported in field "value" for
 meta_query filters.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18707>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list