Open tysonlt opened 10 years ago
I can get it to work by using the following code:
$where =
"bracket.round.tournament.id=$tournament_id " .
"AND match_status.id is not null ". //this is to force pods to generate rel_match_status
"AND ms.code <> '". MatchStatus::INITIAL ."'";
$join =
'LEFT JOIN wp_pods_match_status as ms '.
'ON ms.id = rel_match_status.related_item_id';
//any matches in this tournament?
$match = pods('match', array(
'where' => $where,
'join' => $join
));
Although this works, I'm not terribly keen on going through all the code and doing this.
Can you post the package of your two Pods being called? Pods Admin > Migrate Packages > Export (must enable component)
{"meta":{"version":"2.3.18","build":1389148289},"pods":{"57":{"id":57,"name":"bracket","label":"Brackets","description":"","type":"post_type","storage":"table","object":"","alias":"","fields":{"round":{"id":58,"name":"round","label":"Round","description":"","help":"","class":"","type":"pick","weight":0,"pick_object":"post_type","pick_val":"round","sister_id":"","required":"1","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"size":{"id":59,"name":"size","label":"Size","description":"How many players can be in this bracket.","help":"","class":"","type":"number","weight":1,"pick_object":"","pick_val":"","sister_id":"","required":"1","unique":"0","number_format_type":"slider","number_format":"i18n","number_decimals":"0","number_step":"1","number_min":"2","number_max":"64","number_max_length":"12","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"number_repeatable":"0"},"progression_count":{"id":60,"name":"progression_count","label":"Progression Count","description":"How many winners will progress from this bracket?","help":"","class":"","type":"number","weight":2,"pick_object":"","pick_val":"","sister_id":"","required":"1","unique":"0","number_format_type":"slider","number_format":"i18n","number_decimals":"0","number_step":"1","number_min":"1","number_max":"32","number_max_length":"12","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"number_repeatable":"0"},"players":{"id":61,"name":"players","label":"Players","description":"This field will show players who have signed up for this tournament, but are not yet assigned to another bracket. <br \/><strong>NOTE:<\/strong> this list will be empty until you save the bracket, or if nobody has signed up for the tournament yet. ","help":"","class":"","type":"pick","weight":3,"pick_object":"user","pick_val":"","sister_id":"","required":"0","unique":"0","pick_format_type":"multi","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"system_flags":{"id":161,"name":"system_flags","label":"System Flags","description":"Comma-separated list of flags: FLAG_NO_VALIDATE, FLAG_NO_PRE_SAVE, FLAG_NO_POST_SAVE","help":"","class":"","type":"text","weight":4,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","text_allow_shortcode":"0","text_allow_html":"0","text_allowed_html_tags":"strong em a ul ol li b i","text_max_length":"255","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"1","read_only":"0","roles_allowed":["administrator"],"text_repeatable":0}},"show_in_menu":"1","label_singular":"Bracket","public":"1","show_ui":"1","supports_title":"1","supports_editor":"0","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"bracket","capability_type_extra":"1","has_archive":"0","hierarchical":"0","rewrite":"1","rewrite_with_front":"1","rewrite_feeds":"0","rewrite_pages":"1","query_var":"1","can_export":"1","default_status":"publish","supports_author":"0","supports_thumbnail":"0","supports_excerpt":"0","supports_trackbacks":"0","supports_custom_fields":"0","supports_comments":"0","supports_revisions":"0","supports_page_attributes":"0","supports_post_formats":"0","built_in_taxonomies_category":"0","built_in_taxonomies_link_category":"0","built_in_taxonomies_post_tag":"0","menu_position":"0","show_in_nav_menus":"1","show_in_admin_bar":"1"},"42":{"id":42,"name":"match_status","label":"Match Status","description":"","type":"post_type","storage":"table","object":"","alias":"","fields":{"code":{"id":43,"name":"code","label":"Status Code","description":"The code the computer uses, eg 'INVITED'","help":"","class":"","type":"text","weight":0,"pick_object":"","pick_val":"","sister_id":"","required":"1","unique":"0","text_allow_shortcode":"0","text_allow_html":"0","text_allowed_html_tags":"strong em a ul ol li b i","text_max_length":"15","default_value_parameter":"code","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"text_repeatable":"0"},"description":{"id":44,"name":"description","label":"Description","description":"","help":"","class":"","type":"text","weight":1,"pick_object":"","pick_val":"","sister_id":"","required":"1","unique":"0","text_allow_shortcode":"0","text_allow_html":"0","text_allowed_html_tags":"strong em a ul ol li b i","text_max_length":"255","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"text_repeatable":"0"},"next":{"id":45,"name":"next","label":"Can Move To","description":"Which status can be moved to from here","help":"","class":"","type":"pick","weight":2,"pick_object":"post_type","pick_val":"match_status","sister_id":"","required":"0","unique":"0","pick_format_type":"multi","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"pick_orderby":"menu_order","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_groupby":""},"initial_status":{"id":46,"name":"initial_status","label":"Initial Status","description":"Is this the initial status? (Only one can be initial)","help":"","class":"","type":"boolean","weight":3,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","boolean_format_type":"checkbox","boolean_yes_label":"Yes","boolean_no_label":"No","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"]}},"show_in_menu":"1","label_singular":"Match Status","public":"1","show_ui":"1","supports_title":"1","supports_editor":"0","label_all_items":"- Match Status","publicly_queryable":"0","exclude_from_search":"0","capability_type":"post","capability_type_custom":"match_status","capability_type_extra":"1","has_archive":"0","hierarchical":"0","rewrite":"1","rewrite_with_front":"1","rewrite_feeds":"0","rewrite_pages":"1","query_var":"1","can_export":"1","default_status":"publish","supports_author":"0","supports_thumbnail":"0","supports_excerpt":"0","supports_trackbacks":"0","supports_custom_fields":"0","supports_comments":"0","supports_revisions":"0","supports_page_attributes":"1","supports_post_formats":"0","built_in_taxonomies_category":"0","built_in_taxonomies_link_category":"0","built_in_taxonomies_post_tag":"0","menu_position":"0","show_in_nav_menus":"1","show_in_admin_bar":"1"},"79":{"id":79,"name":"match","label":"Matches","description":"","type":"post_type","storage":"table","object":"","alias":"","fields":{"bracket":{"id":80,"name":"bracket","label":"Tournament \/ Bracket","description":"This field is only shown to admins. Players are assigned to a bracket automatically so they don't need to set it themselves.","help":"","class":"","type":"pick","weight":0,"pick_object":"post_type","pick_val":"bracket","sister_id":"","required":"1","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"1","restrict_role":"0","restrict_capability":"0","hidden":"1","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"player":{"id":81,"name":"player","label":"Player","description":"Only admins can directly set the player.","help":"","class":"","type":"pick","weight":1,"pick_object":"user","pick_val":"","sister_id":"","required":"1","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"1","restrict_role":"0","restrict_capability":"0","hidden":"1","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"opponent":{"id":82,"name":"opponent","label":"Opponent","description":"","help":"","class":"","type":"pick","weight":2,"pick_object":"user","pick_val":"","sister_id":"","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"player_nic":{"id":83,"name":"player_nic","label":"Player NIC","description":"Your NIC on this site. Leave blank to use your default NIC.","help":"","class":"","type":"text","weight":3,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","text_allow_shortcode":"0","text_allow_html":"0","text_allowed_html_tags":"strong em a ul ol li b i","text_max_length":"255","default_value_parameter":"player_nic","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"text_repeatable":"0"},"playing_site":{"id":84,"name":"playing_site","label":"Playing Site","description":"Which site will you play on?","help":"","class":"","type":"pick","weight":4,"pick_object":"post_type","pick_val":"playing_site","sister_id":"","required":"1","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"match_status":{"id":85,"name":"match_status","label":"Match Status","description":"Change the status of this match by selecting one of these options.","help":"","class":"","type":"pick","weight":5,"pick_object":"post_type","pick_val":"match_status","sister_id":"","required":"1","unique":"0","pick_format_type":"single","pick_format_single":"radio","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"pick_orderby":"menu_order","default_value_parameter":"new_match_status","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_groupby":""},"match_length":{"id":269,"name":"match_length","label":"Match Length","description":"","help":"","class":"","type":"number","weight":6,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","number_format_type":"number","number_format":"i18n","number_decimals":"0","number_step":"1","number_min":"0","number_max":"100","number_max_length":"12","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"1","roles_allowed":["administrator"],"number_repeatable":"0"},"score":{"id":86,"name":"score","label":"Score","description":"Enter the final match score here.","help":"","class":"","type":"pick","weight":7,"pick_object":"custom-simple","pick_val":"","sister_id":"","pick_custom":"11-0\n11-1\n11-2\n11-3\n11-4\n11-5\n11-6\n11-7\n11-8\n11-9\n11-10\n15-0\n15-1\n15-2\n15-3\n15-4\n15-5\n15-6\n15-7\n15-8\n15-9\n15-10\n15-11\n15-12\n15-13\n15-14","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_select_text":"-- Enter Score --","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"player_notes":{"id":87,"name":"player_notes","label":"Player Notes","description":"Send a message to your opponent, if you want to.","help":"","class":"","type":"paragraph","weight":8,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","paragraph_allow_html":"1","paragraph_oembed":"0","paragraph_wptexturize":"1","paragraph_convert_chars":"1","paragraph_wpautop":"1","paragraph_allow_shortcode":"0","paragraph_allowed_html_tags":"strong em a ul ol li b i","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"paragraph_repeatable":"0"},"opponent_notes":{"id":88,"name":"opponent_notes","label":"Opponent Notes","description":"Enter a brief response to this invitation, if you want to.","help":"","class":"","type":"paragraph","weight":9,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","paragraph_allow_html":"1","paragraph_oembed":"0","paragraph_wptexturize":"1","paragraph_convert_chars":"1","paragraph_wpautop":"1","paragraph_allow_shortcode":"0","paragraph_allowed_html_tags":"strong em a ul ol li b i","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"paragraph_repeatable":"0"},"match_notes":{"id":89,"name":"match_notes","label":"Match Notes","description":"Enter any match notes here.","help":"","class":"","type":"paragraph","weight":10,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","paragraph_allow_html":"1","paragraph_oembed":"0","paragraph_wptexturize":"1","paragraph_convert_chars":"1","paragraph_wpautop":"1","paragraph_allow_shortcode":"0","paragraph_allowed_html_tags":"strong em a ul ol li b i","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"paragraph_repeatable":"0"},"match_day":{"id":90,"name":"match_day","label":"Match Day","description":"Please choose the day you want to play on.","help":"","class":"","type":"pick","weight":11,"pick_object":"custom-simple","pick_val":"","sister_id":"","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"match_time_slot":{"id":91,"name":"match_time_slot","label":"Match Time Slot","description":"Pick a time to meet your opponent.","help":"","class":"","type":"pick","weight":12,"pick_object":"custom-simple","pick_val":"","sister_id":"","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"match_time":{"id":92,"name":"match_time","label":"Match Time","description":"","help":"","class":"","type":"datetime","weight":13,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","datetime_format":"dMy","datetime_time_type":"12","datetime_time_format":"h_mma","datetime_time_format_24":"hh_mm","datetime_allow_empty":"1","datetime_html5":"0","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"datetime_repeatable":"0"},"timeslot_day":{"id":93,"name":"timeslot_day","label":"Timeslot Day","description":"Records the day of the opponent's selected timeslot","help":"","class":"","type":"number","weight":14,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","number_format_type":"number","number_format":"i18n","number_decimals":"0","number_step":"1","number_min":"0","number_max":"100","number_max_length":"12","default_value_parameter":"timeslot_day","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"1","read_only":"0","roles_allowed":["administrator"],"number_repeatable":"0"},"timeslot_from":{"id":94,"name":"timeslot_from","label":"Timeslot From","description":"Records the opponent's selected timeslot.","help":"","class":"","type":"number","weight":15,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","number_format_type":"number","number_format":"i18n","number_decimals":"0","number_step":"1","number_min":"0","number_max":"100","number_max_length":"12","default_value_parameter":"timeslot_from","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"1","read_only":"0","roles_allowed":["administrator"],"number_repeatable":"0"},"timeslot_to":{"id":95,"name":"timeslot_to","label":"Timeslot To","description":"Records the opponent's selected timeslot.","help":"","class":"","type":"number","weight":16,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","number_format_type":"number","number_format":"i18n","number_decimals":"0","number_step":"1","number_min":"0","number_max":"100","number_max_length":"12","default_value_parameter":"timeslot_to","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"1","read_only":"0","roles_allowed":["administrator"],"number_repeatable":"0"},"invited_by":{"id":96,"name":"invited_by","label":"Invited By","description":"","help":"","class":"","type":"pick","weight":17,"pick_object":"user","pick_val":"","sister_id":"","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"default_value_parameter":"invited_by","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"1","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"invitee":{"id":97,"name":"invitee","label":"Invitee","description":"","help":"","class":"","type":"pick","weight":18,"pick_object":"user","pick_val":"","sister_id":"","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"default_value_parameter":"invitee","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"1","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"winner":{"id":98,"name":"winner","label":"Winner","description":"","help":"","class":"","type":"pick","weight":19,"pick_object":"user","pick_val":"","sister_id":"","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"default_value_parameter":"winner","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"loser":{"id":99,"name":"loser","label":"Loser","description":"","help":"","class":"","type":"pick","weight":20,"pick_object":"user","pick_val":"","sister_id":"","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"match_file":{"id":100,"name":"match_file","label":"Match File","description":"Upload the match log file if available.","help":"","class":"","type":"file","weight":21,"pick_object":"custom-simple","pick_val":"","sister_id":"","required":"0","unique":"0","file_format_type":"single","file_uploader":"plupload","file_attachment_tab":"upload","file_edit_title":"1","file_limit":"0","file_restrict_filesize":"10MB","file_type":"any","file_add_button":"Upload Match Log","file_modal_title":"Attach a file","file_modal_add_button":"Add File","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"file_allowed_extensions":""},"favourite":{"id":270,"name":"favourite","label":"Favourite","description":"","help":"","class":"","type":"pick","weight":22,"pick_object":"user","pick_val":"","sister_id":"","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"underdog":{"id":271,"name":"underdog","label":"Underdog","description":"","help":"","class":"","type":"pick","weight":23,"pick_object":"user","pick_val":"","sister_id":"","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"favourite_chance":{"id":272,"name":"favourite_chance","label":"Favourite Chance","description":"","help":"","class":"","type":"number","weight":24,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","number_format_type":"number","number_format":"i18n","number_decimals":"4","number_step":"1","number_min":"0","number_max":"100","number_max_length":"12","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"1","roles_allowed":["administrator"],"number_repeatable":"0"},"underdog_chance":{"id":273,"name":"underdog_chance","label":"Underdog Chance","description":"","help":"","class":"","type":"number","weight":25,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","number_format_type":"number","number_format":"i18n","number_decimals":"4","number_step":"1","number_min":"0","number_max":"100","number_max_length":"12","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"1","roles_allowed":["administrator"],"number_repeatable":"0"}},"show_in_menu":"1","label_singular":"Match","public":"1","show_ui":"1","supports_title":"0","supports_editor":"0","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"match","capability_type_extra":"1","has_archive":"0","hierarchical":"0","rewrite":"1","rewrite_with_front":"1","rewrite_feeds":"0","rewrite_pages":"1","query_var":"1","can_export":"1","default_status":"publish","supports_author":"0","supports_thumbnail":"0","supports_excerpt":"0","supports_trackbacks":"0","supports_custom_fields":"0","supports_comments":"0","supports_revisions":"0","supports_page_attributes":"0","supports_post_formats":"0","built_in_taxonomies_category":"0","built_in_taxonomies_link_category":"0","built_in_taxonomies_post_tag":"0","menu_position":"0","show_in_nav_menus":"1","show_in_admin_bar":"1"},"55":{"id":55,"name":"round","label":"Rounds","description":"","type":"post_type","storage":"table","object":"","alias":"","fields":{"tournament":{"id":56,"name":"tournament","label":"Tournament","description":"","help":"","class":"","type":"pick","weight":0,"pick_object":"post_type","pick_val":"tournament","sister_id":"310","required":"1","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""}},"show_in_menu":"1","label_singular":"Round","public":"1","show_ui":"1","supports_title":"1","supports_editor":"0","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"round","capability_type_extra":"1","has_archive":"0","hierarchical":"0","rewrite":"1","rewrite_with_front":"1","rewrite_feeds":"0","rewrite_pages":"1","query_var":"1","can_export":"1","default_status":"publish","supports_author":"0","supports_thumbnail":"0","supports_excerpt":"0","supports_trackbacks":"0","supports_custom_fields":"0","supports_comments":"0","supports_revisions":"0","supports_page_attributes":"0","supports_post_formats":"0","built_in_taxonomies_category":"0","built_in_taxonomies_link_category":"0","built_in_taxonomies_post_tag":"0","menu_position":"0","show_in_nav_menus":"1","show_in_admin_bar":"1"},"49":{"id":49,"name":"tournament","label":"Tournaments","description":"","type":"post_type","storage":"table","object":"","alias":"","fields":{"open_date":{"id":50,"name":"open_date","label":"Open Date","description":"When this tournament opens.","help":"","class":"","type":"date","weight":0,"pick_object":"","pick_val":"","sister_id":"","required":"1","unique":"0","date_format":"fjy","date_allow_empty":"1","date_html5":"0","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"date_repeatable":"0"},"close_date":{"id":51,"name":"close_date","label":"Close Date","description":"When this tournament closes.","help":"","class":"","type":"date","weight":1,"pick_object":"","pick_val":"","sister_id":"","required":"1","unique":"0","date_format":"fjy","date_allow_empty":"1","date_html5":"0","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"date_repeatable":"0"},"format":{"id":52,"name":"format","label":"Format","description":"What format does this tournament have?","help":"","class":"","type":"pick","weight":2,"pick_object":"custom-simple","pick_val":"","sister_id":"","pick_custom":"RR|Round-Robin\nKO|Knock-Out","required":"1","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"default_bracket_size":{"id":53,"name":"default_bracket_size","label":"Default Bracket Size","description":"How big will the average bracket be? (This is used when auto-generating random brackets.)","help":"","class":"","type":"number","weight":3,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","number_format_type":"slider","number_format":"i18n","number_decimals":"0","number_step":"1","number_min":"2","number_max":"16","number_max_length":"16","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"number_repeatable":"0"},"match_points":{"id":54,"name":"match_points","label":"Match Points","description":"How many points will be played per match in this tournament?","help":"","class":"","type":"number","weight":4,"pick_object":"","pick_val":"","sister_id":"","required":"1","unique":"0","number_format_type":"slider","number_format":"i18n","number_decimals":"0","number_step":"2","number_min":"3","number_max":"21","number_max_length":"12","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"number_repeatable":"0"},"current_round":{"id":310,"name":"current_round","label":"Current Round","description":"DON'T TOUCH! BAH!!! (\/smacks hand)","help":"","class":"","type":"pick","weight":5,"pick_object":"post_type","pick_val":"round","sister_id":"56","required":"0","unique":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_limit":"0","pick_user_role":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""}},"show_in_menu":"1","label_singular":"Tournament","public":"1","show_ui":"1","supports_title":"1","supports_editor":"0","label_add_new":"Add Tournament","label_all_items":"List Tournaments","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"tournament","capability_type_extra":"1","has_archive":"0","hierarchical":"0","rewrite":"1","rewrite_with_front":"1","rewrite_feeds":"0","rewrite_pages":"1","query_var":"1","can_export":"1","default_status":"publish","supports_author":"0","supports_thumbnail":"0","supports_excerpt":"0","supports_trackbacks":"0","supports_custom_fields":"0","supports_comments":"0","supports_revisions":"0","supports_page_attributes":"0","supports_post_formats":"0","built_in_taxonomies_category":"0","built_in_taxonomies_link_category":"0","built_in_taxonomies_post_tag":"0","menu_position":"0","menu_icon":"\/wp-content\/uploads\/2013\/12\/dice_red_24_ns.png","show_in_nav_menus":"1","show_in_admin_bar":"1"}}}
Hi Scott,
Thanks for looking into this. I have posted the export above - there are actually five pods for that query. A match has a bracket, has a round, has a tournament. A match also has a match_status.
Hello!
When using Pods with CPT and WP-Meta, the query below works. After recreating the Pod to use table-based meta storage to improve performance, I removed the '.meta_value' affix from the relevant field. The query no longer works.
When I removed '.meta_value', I get the following sql:
It seems that Pods is linking to match_status as a reference to the wp_posts table, but is not extending the join to include the match