You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple enough bug, if you sort the Loans table by their return dates the table only displays items that have been returned. I'm guessing because the SQL query only includes Loans that actually have the return date meta value.
Further inspection confirms this is the case as the table is the sorted result on the intersection of the post table and rows of the post meta table for the return date. No return date == not in the intersection.
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
INNER JOIN wp_postmeta
ON ( wp_posts.ID = wp_postmeta.post_id )
WHERE 1=1
AND wp_posts.post_type = 'wp_lib_loans'
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'future'
OR wp_posts.post_status = 'draft'
OR wp_posts.post_status = 'pending'
OR wp_posts.post_status = 'private')
AND ( wp_postmeta.meta_key = 'wp_lib_return_date' )
GROUP BY wp_posts.ID
ORDER BY wp_postmeta.meta_value+0 ASC
LIMIT 0, 20
The will definitely work but not very DRY solution would be to create a custom SQL query via a post_clauses hook. It'd be more sencible however to first see if there's any way to modify the query sufficiently via small pre_get_posts changes. This might be worth leaving until tomorrow as I've been working for 11 or so hours and SQL is loosing its charm.
Simple enough bug, if you sort the Loans table by their return dates the table only displays items that have been returned. I'm guessing because the SQL query only includes Loans that actually have the return date meta value.
Bug was introduced in d762f82 as part of #35
The text was updated successfully, but these errors were encountered: