I think version 2.4.5 introduced a bug
-
Hi, recently had to debug a site that returned an empty array [] when calling $tags = get_tags(array(‘taxonomy’ => ‘my_taxonomy’));. After tracing and debugging I’ve found Simple Custom Post Order to be the cause. The plugin is inserting a ORDER BY term_order but that column doesn’t exist in the DB so fails.
I’ve installed previous versions, and found 2.4.4 the last version working correctly. Checked changes between 2.4.4 and 2.4.5 and this code is probably the cause (not checked):
This is version 2.4.4:
public function scporder_get_terms_orderby($orderby, $args) { if (is_admin()) return $orderby; $tags = $this->get_scporder_options_tags(); if (!isset($args['taxonomy'])) return $orderby; if(is_array($args['taxonomy'])){ $taxonomy = $args['taxonomy'][0]; } else { $taxonomy = $args['taxonomy']; } if (!in_array($taxonomy, $tags)) return $orderby; $orderby = 't.term_order'; return $orderby; }
This is version 2.4.5:
public function scporder_get_terms_orderby($orderby, $args) { if (is_admin()) return $orderby; $tags = $this->get_scporder_options_tags(); if (!isset($args['taxonomy'])) return $orderby; $taxonomy = $args['taxonomy']; if (!in_array($taxonomy, $tags)) return $orderby; $orderby = 't.term_order'; return $orderby; }
Can you please check if I’m correct?
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.