Title: Bug with object sort
Last modified: August 21, 2016

---

# Bug with object sort

 *  Resolved [benfreke](https://wordpress.org/support/users/benfreke/)
 * (@benfreke)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/bug-with-object-sort/)
 * Hi
 * When you use the orderby query var to sort by a custom meta field, the function
   relevanssi_object_sort() throws a notice. Line 44 and line 45 will throw a notice
   as the key is undefined (the data object is only the post).
 * I just put a quick check in above the for loop (line 40) that returns if the 
   key isn’t set on the first data element.
 * if (!isset($data[0]) || !isset($data[0]->$key)) { return; }
 * Could you please make this part of the next upgrade for the free version, so 
   my code doesn’t get over-written when we upgrade the plugin next?
 * [http://wordpress.org/extend/plugins/relevanssi/](http://wordpress.org/extend/plugins/relevanssi/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/bug-with-object-sort/#post-3674434)
 * This is fixed in 3.1.6.

Viewing 1 replies (of 1 total)

The topic ‘Bug with object sort’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/bug-with-object-sort/#post-3674434)
 * Status: resolved