-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Description
I have a player list for a season and a team. The players are currently set as 'Auto'. There should be 20 players but it only shows 5-
This appears to be because of the following query:
FROM wp_posts
LEFT JOIN wp_term_relationships
ON (wp_posts.ID = wp_term_relationships.object_id)
LEFT JOIN wp_postmeta
ON ( wp_posts.ID = wp_postmeta.post_id )
LEFT JOIN wp_postmeta AS mt1
ON ( wp_posts.ID = mt1.post_id )
LEFT JOIN wp_postmeta AS mt2
ON ( wp_posts.ID = mt2.post_id
AND mt2.meta_key = 'sp_assignments' )
WHERE 1=1
AND ( wp_term_relationships.term_taxonomy_id IN (295) )
AND ( wp_postmeta.meta_key = 'sp_number'
AND ( ( ( mt1.meta_key = 'sp_team'
AND mt1.meta_value = '74' ) )
AND mt2.post_id IS NULL
) )
AND wp_posts.post_type = 'sp_player'
AND ((wp_posts.post_status = 'publish'))
GROUP BY ...
ORDER BY wp_postmeta.meta_value
Any player which has any entries in the 'sp_assignment' meta key are being dropped due to the AND mt2.post_id IS NULL clause. Removing this returns all the players as expected.
Is this a bug or am I misunderstanding the feature?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels