pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

WHERE clause with AND of related field ID is not working in shortcode #5935

Closed bell1jl closed 3 years ago

bell1jl commented 3 years ago

Issue Overview

I have an extended users object with a relationship field named "videos_completed". I can have the shortcode output {@videos_completed.ID} on the user object with one item in my WHERE clause. I can query WHERE user.ID=4 and have that return data. I can also query WHERE videos_completed.ID=612 and have it return data. But when I combine the two clauses into WHERE user.ID=4 AND videos_completed.ID=612 I get nothing.

Expected Behavior

Not much to say here. I'm expecting the WHERE clause to allow an AND on a related field ID.

Current Behavior

Steps to Reproduce (for bugs)

  1. Create a POD with name "training_video"
  2. Add a relationship field to User
  3. Extend User object with a relationship field called "videos_completed". It should relate back to the training_video POD field as a bi-directional relationship.
  4. Create a new training video and select a valid user to associate with the video. Publish the POD
  5. Find the ID of your training video and your user
  6. On the front end, enter the following shortcodes:

[pods name="user" where="ID="] User.ID Only: {@videos_completed.ID} [/pods]

[pods name="user" where="videos_completed.ID="] Video ID Only: {@videos_completed.ID} [/pods]

[pods name="user" where="ID= AND videos_completed.ID="] Both: {@videos_completed.ID} [/pods]

You should return the @videos_complete.ID for for the User.ID Only, the Video ID Only, but not both.

Possible Solution

WordPress Environment

``` Debug Information WordPress Version: 5.6 PHP Version: 7.4.14 MySQL Version: 5.7.32 Server Software: Apache Your User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 Session Save Path: /var/lib/php/sessions Session Save Path Exists: Yes Session Save Path Writeable: Yes Session Max Lifetime: 1440 Opcode Cache: Apc: No Memcached: No OPcache: Yes Redis: No Object Cache: APC: No APCu: No Memcache: No Memcached: Yes Redis: Yes WPDB Prefix: wp_ WP Multisite Mode: Yes WP Memory Limit: 64M Current Memory Usage: 20.462M Current Memory Usage (real): 10.000M Pods Network-Wide Activated: Yes Pods Install Location: /nas/content/live/dottsite/wp-content/plugins/pods/ Pods Tableless Mode Activated: No Pods Light Mode Activated: No Currently Active Theme: DOTT Currently Active Plugins: Admin Menu Editor: 1.9.8 Code Snippets: 2.14.0 Content Control: 1.1.4 Gravity Forms: 2.4.22.3 Gravity Forms HubSpot Add-On: 1.5 Gravity Forms User Registration Add-On: 4.7 Gravity Forms Zapier Add-on: 3.3 If Menu - Visibility control for menu items: 0.16.2 NS Cloner - Site Copier: 4.1.5.2 Pods - Custom Content Types and Fields: 2.7.26 Pods Gravity Forms Add-On: 1.4.3 ShortCode Redirect: 1.0.02 Show Current Template: 0.4.3 User Roles and Capabilities: 1.2.4 Zapier for WordPress: 1.0.2

Pods Package Export (helpful!)

{"meta":{"version":"2.7.26","build":1612987012},"pods":{"226":{"id":226,"name":"brand","label":"Brands","description":"","type":"post_type","storage":"meta","object":"","alias":"","fields":{"primary_color":{"id":227,"name":"primary_color","label":"Primary Color","description":"Brand's primary color","help":"","class":"brand-color","type":"color","weight":0,"pick_object":"","pick_val":"","sister_id":"","required":"1","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","color_repeatable":"0"},"logo":{"id":228,"name":"logo","label":"Logo","description":"","help":"","class":"brand-logo","type":"file","weight":1,"pick_object":"custom-simple","pick_val":"","sister_id":"","required":"1","file_format_type":"single","file_uploader":"attachment","file_attachment_tab":"upload","file_edit_title":"0","file_show_edit_link":"0","file_linked":"0","file_limit":"0","file_restrict_filesize":"10MB","file_type":"images","file_field_template":"rows","file_add_button":"Add Logo","file_modal_title":"Select a logo","file_modal_add_button":"Add Logo","file_wp_gallery_output":"0","file_wp_gallery_link":"post","file_wp_gallery_columns":"1","file_wp_gallery_random_sort":"0","file_wp_gallery_size":"thumbnail","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","file_allowed_extensions":""},"location_contact":{"id":240,"name":"location_contact","label":"Location Contact","description":"Who is the contact at this brand for each location member to contact if they have question? This will be displayed in the footer of the site.","help":"","class":"test-class","type":"wysiwyg","weight":2,"pick_object":"","pick_val":"","sister_id":"","required":"0","wysiwyg_editor":"tinymce","wysiwyg_media_buttons":"0","wysiwyg_oembed":"0","wysiwyg_wptexturize":"1","wysiwyg_convert_chars":"1","wysiwyg_wpautop":"1","wysiwyg_allow_shortcode":"0","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","wysiwyg_repeatable":"0","wysiwyg_editor_height":"100","wysiwyg_allowed_html_tags":""},"location_contact_email":{"id":635,"name":"location_contact_email","label":"Location Contact Email","description":"The brand contact's email address","help":"","class":"","type":"email","weight":3,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","email_max_length":"255","email_html5":"0","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","email_repeatable":"0","email_placeholder":""}},"show_in_menu":"1","label_singular":"Brand","public":"1","show_ui":"1","supports_title":"1","supports_editor":"0","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"brand","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":"draft","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","built_in_taxonomies_project_category":"0","built_in_taxonomies_project_tag":"0","menu_position":"0","show_in_nav_menus":"1","show_in_admin_bar":"1","pfat_enable":"0","pfat_append_single":"append","pfat_filter_single":"the_content","pfat_append_archive":"append","pfat_filter_archive":"the_excerpt","pfat_run_outside_loop":"0","rest_enable":"1","read_all":"1","write_all":"1","built_in_taxonomies_course_category":"0"},"63":{"id":63,"name":"location","label":"Locations","description":"A physical location of the business. Generally a city and state or a store number.","type":"post_type","storage":"meta","object":"","alias":"","fields":{"location_brand":{"id":233,"name":"location_brand","label":"Brand","description":"You'll need to set the brand for this location to set the color and logo","help":"","class":"","type":"pick","weight":0,"pick_object":"post_type","pick_val":"brand","sister_id":"","required":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_display_format_multi":"default","pick_display_format_separator":", ","pick_allow_add_new":"1","pick_taggable":"0","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":[],"pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"street_address":{"id":64,"name":"street_address","label":"Street Address","description":"Street number and address.","help":"","class":"","type":"paragraph","weight":1,"pick_object":"","pick_val":"","sister_id":"","required":"1","paragraph_allow_html":"0","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","paragraph_max_length":"300","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"1","rest_write":"1","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","paragraph_repeatable":"0","paragraph_placeholder":""},"city":{"id":65,"name":"city","label":"City","description":"","help":"","class":"","type":"text","weight":2,"pick_object":"","pick_val":"","sister_id":"","required":"1","text_allow_shortcode":"0","text_allow_html":"0","text_allowed_html_tags":"strong em a ul ol li b i","text_max_length":"255","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","text_repeatable":"0","text_placeholder":""},"state":{"id":66,"name":"state","label":"State","description":"","help":"","class":"","type":"text","weight":3,"pick_object":"","pick_val":"","sister_id":"","required":"1","text_allow_shortcode":"0","text_allow_html":"0","text_allowed_html_tags":"strong em a ul ol li b i","text_max_length":"255","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","text_repeatable":"0","text_placeholder":""},"postal_code":{"id":67,"name":"postal_code","label":"Postal Code","description":"","help":"","class":"","type":"text","weight":4,"pick_object":"","pick_val":"","sister_id":"","required":"1","text_allow_shortcode":"0","text_allow_html":"0","text_allowed_html_tags":"strong em a ul ol li b i","text_max_length":"255","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","text_repeatable":"0","text_placeholder":""},"dashboard_url":{"id":68,"name":"dashboard_url","label":"Dashboard URL","description":"What's the URL of the reporting dashboard for this location?","help":"","class":"","type":"website","weight":5,"pick_object":"","pick_val":"","sister_id":"","required":"1","website_format":"normal","website_allow_port":"1","website_clickable":"0","website_new_window":"0","website_max_length":"255","website_html5":"0","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","website_repeatable":"0","default_value":"about:blank","website_placeholder":""},"location_users":{"id":69,"name":"location_users","label":"Location Users","description":"","help":"","class":"","type":"pick","weight":6,"pick_object":"user","pick_val":"","sister_id":"71","required":"0","pick_format_type":"multi","pick_format_single":"dropdown","pick_format_multi":"list","pick_display_format_multi":"default","pick_display_format_separator":", ","pick_allow_add_new":"1","pick_taggable":"0","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":[],"pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""}},"show_in_menu":"1","label_singular":"Location","public":"1","show_ui":"1","supports_title":"1","supports_editor":"0","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"location","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":"draft","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","built_in_taxonomies_project_category":"0","built_in_taxonomies_project_tag":"0","menu_position":"65.3","show_in_nav_menus":"1","show_in_admin_bar":"1","pfat_enable":"0","pfat_append_single":"append","pfat_filter_single":"the_content","pfat_append_archive":"append","pfat_filter_archive":"the_excerpt","pfat_run_outside_loop":"0","rest_enable":"1","read_all":"1","write_all":"1","menu_icon":"dashicons-location","built_in_taxonomies_course_category":"0"},"588":{"id":588,"name":"service","label":"Services","description":"","type":"post_type","storage":"meta","object":"","alias":"","fields":{"description":{"id":589,"name":"description","label":"Description","description":"","help":"","class":"","type":"paragraph","weight":0,"pick_object":"","pick_val":"","sister_id":"","required":"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","paragraph_max_length":"0","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","paragraph_repeatable":"0","paragraph_placeholder":""},"price":{"id":590,"name":"price","label":"Price","description":"","help":"","class":"","type":"currency","weight":1,"pick_object":"","pick_val":"","sister_id":"","required":"0","currency_format_type":"number","currency_format_sign":"aud","currency_format_placement":"before","currency_format":"i18n","currency_decimals":"2","currency_decimal_handling":"none","currency_step":"1","currency_min":"0","currency_max":"1000","currency_max_length":"12","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","currency_repeatable":"0","currency_placeholder":""},"image":{"id":591,"name":"image","label":"Image","description":"","help":"","class":"","type":"file","weight":2,"pick_object":"custom-simple","pick_val":"","sister_id":"","required":"0","file_format_type":"single","file_uploader":"attachment","file_attachment_tab":"upload","file_edit_title":"1","file_show_edit_link":"0","file_linked":"0","file_limit":"0","file_restrict_filesize":"10MB","file_type":"images","file_field_template":"rows","file_add_button":"Add File","file_modal_title":"Attach a file","file_modal_add_button":"Add File","file_wp_gallery_output":"0","file_wp_gallery_link":"post","file_wp_gallery_columns":"1","file_wp_gallery_random_sort":"0","file_wp_gallery_size":"thumbnail","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","file_allowed_extensions":""},"associated_video":{"id":592,"name":"associated_video","label":"Associated Video","description":"","help":"","class":"","type":"pick","weight":3,"pick_object":"post_type","pick_val":"training_video","sister_id":"593","required":"0","pick_format_type":"multi","pick_format_single":"dropdown","pick_format_multi":"list","pick_display_format_multi":"default","pick_display_format_separator":", ","pick_allow_add_new":"1","pick_taggable":"0","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":[],"pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""}},"show_in_menu":"1","label_singular":"Service","public":"1","show_ui":"1","supports_title":"1","supports_editor":"1","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"service","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":"draft","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_course_category":"0","built_in_taxonomies_link_category":"0","built_in_taxonomies_post_tag":"0","built_in_taxonomies_project_category":"0","built_in_taxonomies_project_tag":"0","menu_position":"0","show_in_nav_menus":"1","show_in_admin_bar":"1","pfat_enable":"1","pfat_append_single":"replace","pfat_filter_single":"the_content","pfat_append_archive":"append","pfat_filter_archive":"the_excerpt","pfat_run_outside_loop":"0","rest_enable":"0","read_all":"0","write_all":"0","pfat_single":"Single Service Item Template"},"217":{"id":217,"name":"ticket","label":"Tickets","description":"","type":"post_type","storage":"meta","object":"","alias":"","fields":{"ticket_type":{"id":218,"name":"ticket_type","label":"Ticket Type","description":"","help":"","class":"","type":"pick","weight":0,"pick_object":"custom-simple","pick_val":"","sister_id":"","pick_custom":"I have a question\nI need something fixed or changed\nI need something quoted","required":"1","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_display_format_multi":"default","pick_display_format_separator":", ","pick_allow_add_new":"1","pick_taggable":"0","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":[],"pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"1","rest_write":"1","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"ticket_description":{"id":219,"name":"ticket_description","label":"Description","description":"","help":"","class":"","type":"wysiwyg","weight":1,"pick_object":"","pick_val":"","sister_id":"","required":"1","wysiwyg_editor":"tinymce","wysiwyg_media_buttons":"1","wysiwyg_oembed":"1","wysiwyg_wptexturize":"1","wysiwyg_convert_chars":"1","wysiwyg_wpautop":"1","wysiwyg_allow_shortcode":"0","wysiwyg_allowed_html_tags":"strong em ul ol a b li i","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"1","rest_write":"1","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","wysiwyg_repeatable":"0","wysiwyg_editor_height":""},"ticket_status":{"id":220,"name":"ticket_status","label":"Ticket Status","description":"","help":"","class":"","type":"pick","weight":2,"pick_object":"custom-simple","pick_val":"","sister_id":"","pick_custom":"a-submitted|Submitted\nb-wait_agency|Waiting on Agency\nc-wait_client|Waiting on Client\nd-closed|Closed","required":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_display_format_multi":"default","pick_display_format_separator":", ","pick_allow_add_new":"1","pick_taggable":"0","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":[],"pick_post_status":["publish"],"admin_only":"1","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"1","rest_write":"1","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"ticket_attachment":{"id":221,"name":"ticket_attachment","label":"Attachment","description":"Add any additional attachments","help":"","class":"","type":"file","weight":3,"pick_object":"custom-simple","pick_val":"","sister_id":"","required":"0","file_format_type":"multi","file_uploader":"attachment","file_attachment_tab":"upload","file_edit_title":"0","file_show_edit_link":"0","file_linked":"1","file_limit":"3","file_restrict_filesize":"10MB","file_type":"images","file_field_template":"rows","file_add_button":"Add File","file_modal_title":"Attach a file","file_modal_add_button":"Add File","file_wp_gallery_output":"0","file_wp_gallery_link":"file","file_wp_gallery_columns":"3","file_wp_gallery_random_sort":"0","file_wp_gallery_size":"thumbnail","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"1","rest_write":"1","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","file_allowed_extensions":""},"hubspot_ticket_id":{"id":289,"name":"hubspot_ticket_id","label":"HubSpot Ticket ID","description":"","help":"","class":"","type":"number","weight":4,"pick_object":"","pick_val":"","sister_id":"","required":"0","number_format_type":"number","number_format":"9999.99","number_decimals":"0","number_format_soft":"0","number_step":"1","number_min":"0","number_max":"100","number_max_length":"12","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"1","rest_write":"1","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","number_repeatable":"0","number_placeholder":""},"submitted_by_id":{"id":331,"name":"submitted_by_id","label":"Submitted By","description":"The WordPress User Id of the user who submitted the ticket","help":"","class":"","type":"number","weight":5,"pick_object":"","pick_val":"","sister_id":"","required":"0","number_format_type":"number","number_format":"9999.99","number_decimals":"0","number_format_soft":"0","number_step":"1","number_min":"0","number_max":"100","number_max_length":"12","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"1","rest_write":"1","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","number_repeatable":"0","number_placeholder":""}},"show_in_menu":"1","label_singular":"Ticket","public":"1","show_ui":"1","supports_title":"1","supports_editor":"0","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"ticket","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":"1","supports_thumbnail":"0","supports_excerpt":"0","supports_trackbacks":"0","supports_custom_fields":"0","supports_comments":"1","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","built_in_taxonomies_project_category":"0","built_in_taxonomies_project_tag":"0","menu_position":"0","show_in_nav_menus":"1","show_in_admin_bar":"1","pfat_enable":"1","pfat_append_single":"append","pfat_filter_single":"the_content","pfat_append_archive":"replace","pfat_filter_archive":"the_excerpt","pfat_run_outside_loop":"0","rest_enable":"1","read_all":"1","write_all":"1","menu_icon":"dashicons-clipboard","pfat_single":"Single Ticket","built_in_taxonomies_course_category":"0"},"553":{"id":553,"name":"course_category","label":"Training Category","description":"","type":"taxonomy","storage":"meta","object":"","alias":"","fields":{"video":{"id":558,"name":"video","label":"Video Embed Code","description":"Paste the embed code for the video here.","help":"","class":"","type":"code","weight":0,"pick_object":"","pick_val":"","sister_id":"","required":"0","code_allow_shortcode":"0","code_max_length":"0","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","code_repeatable":"0"},"category_introduction":{"id":559,"name":"category_introduction","label":"Category Introduction","description":"","help":"","class":"","type":"wysiwyg","weight":1,"pick_object":"","pick_val":"","sister_id":"","required":"1","wysiwyg_editor":"tinymce","wysiwyg_media_buttons":"1","wysiwyg_oembed":"0","wysiwyg_wptexturize":"1","wysiwyg_convert_chars":"1","wysiwyg_wpautop":"1","wysiwyg_allow_shortcode":"0","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","wysiwyg_repeatable":"0","wysiwyg_editor_height":"","wysiwyg_allowed_html_tags":""}},"show_in_menu":"1","label_singular":"Training Category","public":"1","show_ui":"1","hierarchical":"1","rewrite":"1","rewrite_with_front":"1","rewrite_hierarchical":"1","capability_type":"default","capability_type_custom":"course_category","query_var":"0","sort":"0","built_in_post_types_brand":"0","built_in_post_types_custom_css":"0","built_in_post_types_customize_changeset":"0","built_in_post_types_et_body_layout":"0","built_in_post_types_et_footer_layout":"0","built_in_post_types_et_header_layout":"0","built_in_post_types_et_template":"0","built_in_post_types_et_theme_builder":"0","built_in_post_types_location":"0","built_in_post_types_oembed_cache":"0","built_in_post_types_page":"0","built_in_post_types_post":"0","built_in_post_types_project":"0","built_in_post_types_ticket":"0","built_in_post_types_user_request":"0","built_in_post_types_wp_block":"0","built_in_post_types_attachment":"0","menu_location":"default","menu_position":"0","show_in_nav_menus":"1","show_tagcloud":"1","show_tagcloud_in_edit":"1","show_in_quick_edit":"1","show_admin_column":"1","pfat_enable":"0","pfat_append_single":"append","pfat_filter_single":"get_the_archive_description","rest_enable":"0","read_all":"0","write_all":"0","built_in_post_types_training_video":"1","built_in_post_types_service":"0"},"186":{"id":186,"name":"training_video","label":"Training Videos","description":"","type":"post_type","storage":"meta","object":"","alias":"","fields":{"video_embed":{"id":261,"name":"video_embed","label":"Video Embed","description":"Embed code for the video.","help":"","class":"training-video-embed","type":"code","weight":0,"pick_object":"","pick_val":"","sister_id":"","required":"0","code_allow_shortcode":"0","code_max_length":"0","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","code_repeatable":"0"},"training_description":{"id":574,"name":"training_description","label":"Training Description","description":"","help":"","class":"","type":"wysiwyg","weight":1,"pick_object":"","pick_val":"","sister_id":"","required":"0","wysiwyg_editor":"tinymce","wysiwyg_media_buttons":"1","wysiwyg_oembed":"0","wysiwyg_wptexturize":"1","wysiwyg_convert_chars":"1","wysiwyg_wpautop":"1","wysiwyg_allow_shortcode":"0","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","wysiwyg_repeatable":"0","wysiwyg_editor_height":"","wysiwyg_allowed_html_tags":""},"video_thumbnail":{"id":637,"name":"video_thumbnail","label":"Video Thumbnail","description":"","help":"","class":"","type":"file","weight":2,"pick_object":"custom-simple","pick_val":"","sister_id":"","required":"0","file_format_type":"single","file_uploader":"attachment","file_attachment_tab":"upload","file_edit_title":"0","file_show_edit_link":"0","file_linked":"0","file_limit":"0","file_restrict_filesize":"10MB","file_type":"images","file_field_template":"rows","file_add_button":"Add File","file_modal_title":"Attach a file","file_modal_add_button":"Add File","file_wp_gallery_output":"0","file_wp_gallery_link":"post","file_wp_gallery_columns":"1","file_wp_gallery_random_sort":"0","file_wp_gallery_size":"thumbnail","pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","file_allowed_extensions":""},"associated_services":{"id":593,"name":"associated_services","label":"Associated Services","description":"","help":"","class":"","type":"pick","weight":3,"pick_object":"post_type","pick_val":"service","sister_id":"592","required":"0","pick_format_type":"multi","pick_format_single":"dropdown","pick_format_multi":"list","pick_display_format_multi":"default","pick_display_format_separator":", ","pick_allow_add_new":"1","pick_taggable":"0","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":[],"pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"completed_by_users":{"id":664,"name":"completed_by_users","label":"Completed By Users","description":"","help":"","class":"","type":"pick","weight":4,"pick_object":"user","pick_val":"","sister_id":"665","required":"0","pick_format_type":"multi","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_display_format_multi":"default","pick_display_format_separator":", ","pick_allow_add_new":"0","pick_taggable":"0","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":[],"pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","pick_display":"{@name}","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_where":"","pick_orderby":"","pick_groupby":""}},"show_in_menu":"1","label_singular":"Training Video","public":"1","show_ui":"1","supports_title":"1","supports_editor":"0","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"training_video","capability_type_extra":"1","has_archive":"1","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","built_in_taxonomies_project_category":"0","built_in_taxonomies_project_tag":"0","menu_position":"0","menu_icon":"dashicons-welcome-learn-more","show_in_nav_menus":"1","show_in_admin_bar":"1","pfat_enable":"1","pfat_append_single":"replace","pfat_filter_single":"the_content","pfat_append_archive":"append","pfat_filter_archive":"the_excerpt","pfat_run_outside_loop":"0","rest_enable":"0","read_all":"0","write_all":"0","built_in_taxonomies_course_category":"1","pfat_single":"Training Video - Single"},"70":{"id":70,"name":"user","label":"User","description":"","type":"user","storage":"meta","object":"user","alias":"","fields":{"location":{"id":71,"name":"location","label":"Location","description":"You may select more than one option from the list","help":"","class":"","type":"pick","weight":0,"pick_object":"post_type","pick_val":"location","sister_id":"69","required":"1","pick_format_type":"multi","pick_format_single":"dropdown","pick_format_multi":"list","pick_display_format_multi":"custom","pick_display_format_separator":", ","pick_allow_add_new":"1","pick_taggable":"0","pick_show_icon":"1","pick_show_edit_link":"0","pick_show_view_link":"0","pick_limit":"0","pick_user_role":[],"pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"1","rest_write":"1","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"videos_completed":{"id":665,"name":"videos_completed","label":"Videos Completed","description":"","help":"","class":"","type":"pick","weight":1,"pick_object":"post_type","pick_val":"training_video","sister_id":"664","required":"0","pick_format_type":"multi","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_display_format_multi":"default","pick_display_format_separator":", ","pick_allow_add_new":"0","pick_taggable":"0","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":[],"pick_post_status":["publish"],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""}},"show_in_menu":1,"pfat_enable":"0","pfat_append_single":"append","pfat_filter_single":"get_the_author_description","pfat_append_archive":"append","pfat_filter_archive":"get_the_author_description","rest_enable":"1","read_all":"1","write_all":"1"}},"templates":{"Training Video - List":{"id":581,"name":"Training Video - List","code":"  <!-- .et_pb_row -->\r\n                                        <div class=\"et_pb_row et_pb_row_1 et_pb_equal_columns\">\r\n                                            <div class=\"et_pb_column et_pb_column_2_5 et_pb_column_1  et_pb_css_mix_blend_mode_passthrough\">\r\n                                                <div class=\"et_pb_module et_pb_image et_pb_image_0\">\r\n                                                        {@video_thumbnail._img.medium}\r\n                                                <\/div>\r\n                                            <\/div>\r\n                                            <!-- .et_pb_column -->\r\n                                            <div class=\"et_pb_column et_pb_column_3_5 et_pb_column_2  et_pb_css_mix_blend_mode_passthrough et-last-child\">\r\n                                                <div class=\"et_pb_module et_pb_text et_pb_text_0  et_pb_text_align_left et_pb_bg_layout_light\">\r\n                                                    <div class=\"et_pb_text_inner\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h2>{@post_title}<\/h2>\r\n                                                        <p>{@training_description}<\/p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{@guid}\">View Video<\/a>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\r\n                                                <\/div>\r\n                                                <!-- .et_pb_text -->\r\n                                            <\/div>\r\n                                            <!-- .et_pb_column -->\r\n                                        <\/div>\r\n                                        <!-- .et_pb_row -->","type":"template","slug":"video-list","options":{"_edit_lock":"1612968033:1","_edit_last":"1","admin_only":"","restrict_capability":"","capability_allowed":"","show_restrict_message":"","restrict_message":"","pod_reference":"a:1:{s:3:\"pod\";s:14:\"training_video\";}"}},"Single Service Item":{"id":597,"name":"Single Service Item","code":"<p>Description: {@description}<\/p>\r\n<p>{@price}<\/p>","type":"template","slug":"single-service-item-template","options":{"_edit_lock":"1612890069:1","_edit_last":"1","admin_only":"","restrict_capability":"","capability_allowed":"","show_restrict_message":"1","restrict_message":"","pod_reference":"a:1:{s:3:\"pod\";s:7:\"service\";}"}},"Training Video - Single":{"id":601,"name":"Training Video - Single","code":"[pods shortcode=1]\r\n{@video_embed}\r\n<hr>\r\n<p>{@training_description}<\/p>\r\n<ul>\r\n[each associated_services]\r\n\t<li>{@associated_services.post_name}<\/li>\t\r\n[\/each]\r\n\t\r\n<\/ul>\r\n\r\nCompleted By: \r\n<ul>\r\n[each completed_by_users]\r\n\t<li>{@completed_by_users.ID}<\/li>\r\n\t[pods name=\"user\" where=\"{@user.ID}={@completed_by_users.ID}\"]{@user.name}[\/pods]\r\n[\/each]\r\n\r\n\t\r\n","type":"template","slug":"single-training-video","options":{"_edit_lock":"1612981250:1","_edit_last":"1","admin_only":"","restrict_capability":"","capability_allowed":"","show_restrict_message":"","restrict_message":"","pod_reference":"a:1:{s:3:\"pod\";s:14:\"training_video\";}"}},"brand_footer":{"id":609,"name":"brand_footer","code":"<div class=\"et_pb_column et_pb_column_1_4 et_pb_column_1  et_pb_css_mix_blend_mode_passthrough\">\r\n\r\n<div class=\"et_pb_module et_pb_image et_pb_image_0\">\r\n\r\n<span class=\"et_pb_image_wrap \">\r\n<img loading=\"lazy\" src=\"{@location_brand.logo._src}\" alt=\"\" title=\"{@location_contact}\" height=\"auto\" width=\"200px\" \/>\r\n<\/span>\r\n<\/div>\r\n<\/div>\r\n<!-- .et_pb_column -->\r\n<div class=\"et_pb_column et_pb_column_3_4 et_pb_column_2  et_pb_css_mix_blend_mode_passthrough et-last-child\">\r\n\r\n<div class=\"et_pb_module et_pb_text et_pb_text_0  et_pb_text_align_left et_pb_bg_layout_light\">\r\n\r\n<div class=\"et_pb_text_inner\">\r\n<p><span style=\"color:{@location_brand.primary_color}; font-weight:bold;\">Your organization’s DOTT administrator is:<\/span><br>\r\n\t{@location_brand.location_contact}<a href=\"mailto:{@location_brand.location_contact_email}\" style=\"color:{@location_brand.primary_color}; text-decoration:underline;\">{@location_brand.location_contact_email}<\/a><\/p>\r\n<\/div>\r\n<\/div>\r\n<!-- .et_pb_text -->\r\n<\/div>\r\n<!-- .et_pb_column -->\r\n","type":"template","slug":"footer-testing","options":{"_edit_lock":"1612972819:1","_edit_last":"1","admin_only":"","restrict_capability":"","capability_allowed":"","show_restrict_message":"1","restrict_message":"","pod_reference":"a:1:{s:3:\"pod\";s:8:\"location\";}"}},"Ticket List":{"id":360,"name":"Ticket List","code":"<b>{@ticket_type}<\/b>","type":"template","slug":"ticket-list","options":{"_edit_lock":"1612821179:1","_edit_last":"1","admin_only":"","restrict_capability":"","capability_allowed":"","show_restrict_message":"1","restrict_message":"","pod_reference":"a:1:{s:3:\"pod\";s:6:\"ticket\";}"}},"Dashboard Template":{"id":120,"name":"Dashboard Template","code":"<div class=\"location_dashboard\">\r\n<h2>{@post_title}<\/h2>\t\r\n<iframe style=\"width: 100%; height: 800px; background-color: #efefef;\" src=\"{@dashboard_url}?i\" frameborder=\"0\"><\/iframe>\r\n<\/div>","type":"template","slug":"dashboard-template","options":{"_edit_lock":"1612962317:1","_edit_last":"1","admin_only":"","restrict_capability":"","capability_allowed":"","show_restrict_message":"1","restrict_message":"","pod_reference":"a:1:{s:3:\"pod\";s:8:\"location\";}"}},"Single Ticket":{"id":503,"name":"Single Ticket","code":"<p>THIS IS COMING FROM THE PODS TEMPLATE CALLED SINGLE TICKET<\/p>\r\n<strong>Ticket Description<\/strong>\r\n<p>{@ticket_description}<\/p>\r\n<p>Comment Status: {@comment_status}<\/p>","type":"template","slug":"single-ticket","options":{"_edit_lock":"1612962466:1","_edit_last":"1","admin_only":"","restrict_capability":"","capability_allowed":"","show_restrict_message":"1","restrict_message":"","pod_reference":"a:1:{s:3:\"pod\";s:6:\"ticket\";}"}}}}

Workaround or Alternate Solution Until Bug is Addressed

Related Issues and/or PRs

JoryHogeveen commented 3 years ago

Hi @bell1jl

For a where clause you need to add .meta_value to custom (metadata) fields.

Cheers, Jory

bell1jl commented 3 years ago

How do I get the ID of those fields? .meta_value.ID?

On Thu, Feb 11, 2021 at 4:16 AM Jory Hogeveen notifications@github.com wrote:

Hi @bell1jl https://github.com/bell1jl

For a where clause you need to add .meta_value to custom (metadata) fields.

Cheers, Jory

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pods-framework/pods/issues/5935#issuecomment-777301443, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGAO5KY6NTHQP73FZVVIETS6OOAPANCNFSM4XNSMHTQ .

bell1jl commented 3 years ago

@JoryHogeveen I'm not trying to get the value, I'm trying to get the ID. I understand that if I wanted the value, I'd need to use the .meta_value reference. But I'm trying to get the ID of object. In every other example I've seen, I've just used field.ID and it worked perfectly fine. In fact, in the example above, I can use each statement with field.ID and I get the correct items returned. It's only when I combine the two statements that I get no results.

bell1jl commented 3 years ago

Here are the exact shortcodes and output I'm seeing. No matter if I start with the training_video object or the user object, the result is the same when I try to combine a query using associated IDs from each.

WORKS

[pods name="training_video" where="ID=612"]
<table>
[each completed_by_users]
<tr><td>{@display_name}</td><td>{@ID}</td></tr>
[/each]
</table>
[/pods]

OUTPUT image

WORKS

[pods name="training_video" where="completed_by_users.ID=4"]
<table>
[each completed_by_users]
<tr><td>{@display_name}</td><td>{@ID}</td></tr>
[/each]
</table>
[/pods]

OUTPUT image

DOES NOT WORK

[pods name="training_video" where="completed_by_users.ID=4 AND ID=612"]
<table>
[each completed_by_users]
<tr><td>{@display_name}</td><td>{@ID}</td></tr>
[/each]
</table>
[/pods]

OUTPUT

jimtrue commented 3 years ago

@JoryHogeveen he's not using a meta value, he's using an ID to match against. This is going to require pulling in his export, I believe.