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

Taggable Autocomplete field option not working in 2.8 #6182

Closed devlamconstructie closed 3 years ago

devlamconstructie commented 3 years ago

Description

custom fields referencing custom taxonomies do not properly query the related custom taxonomy and do not allow adding of new items in the custom taxonomy.

Testing instructions

  1. create new CPT
  2. create new custom taxonomy.
  3. associate with CPT
  4. Enable Rest, also enable Show and allow Update.
  5. Save, edit CPT
  6. add field, type relationship
  7. addition field options: multiple select, autocomplete, allow add new, taggable.
  8. go to edit cpt entry. attempt to create new tag by typing. nothing happens.
  9. enable Admin UI for tag, add tags manually
  10. back to edit cpt entry. type to find manually added tags. message '0 results' in select list.

Expected behavior

in step 7: type, if no record found, add new on enter.

Screenshots / screencast

Possible workaround

reverting to 2.7.31 :(

Pods version

2.8

Other super helpful information

WordPress Environment

`

wp-core

version: 5.8.1 site_language: nl_NL user_language: en_US timezone: +00:00 permalink: /%category%/%postname%/ https_status: true multisite: false user_registration: 0 blog_public: 1 default_comment_status: undefined environment_type: production user_count: 1 dotorg_communication: true

wp-paths-sizes

wordpress_path: /opt/bitnami/wordpress wordpress_size: 48,64 MB (51003763 bytes) uploads_path: /opt/bitnami/wordpress/wp-content/uploads uploads_size: 579,38 KB (593289 bytes) themes_path: /opt/bitnami/wordpress/wp-content/themes themes_size: 9,76 KB (9993 bytes) plugins_path: /opt/bitnami/wordpress/wp-content/plugins plugins_size: 87,55 MB (91803442 bytes) database_size: 8,97 MB (9404416 bytes) total_size: 145,74 MB (152814903 bytes)

wp-active-theme

name: Intentionally Blank (intentionally-blank) version: 2.2 author: Nilo Velez author_website: https://www.nilovelez.com/ parent_theme: none theme_features: core-block-patterns, html5, widgets-block-editor, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, menus, post-thumbnails, title-tag theme_path: fake auto_update: Disabled

wp-plugins-active (15)

All-in-One WP Migration: version: 7.49, author: ServMask, Auto-updates disabled All-in-One WP Migration Unlimited Extension: version: 2.42, author: ServMask, Auto-updates disabled Asset CleanUp: Page Speed Booster: version: 1.3.8.4, author: Gabe Livan, Auto-updates disabled Cloudflare: version: 4.6.0, author: Cloudflare, Inc., Auto-updates disabled Code Snippets: version: 2.14.2, author: Code Snippets Pro, Auto-updates disabled devlaminteractie plugin: version: 0.03, author: Willem de Vlam, Auto-updates disabled Editor Enhancer for Oxygen: version: 1.1.2, author: Ukuwi, Auto-updates disabled Gravity Forms: version: 2.5.12, author: Gravity Forms, Auto-updates disabled Gravity Forms Custom Javascript: version: 1.4, author: Gravity Wiz, Auto-updates disabled Oxygen: version: 3.8.1, author: Soflyy, Auto-updates disabled Oxy Toolbox: version: 1.5.4, author: Gagan S Goraya, Sridhar Katakam, Auto-updates disabled Pods - Custom Content Types and Fields: version: 2.7.31, author: Pods Framework Team (latest version: 2.8.0), Auto-updates disabled Rank Math SEO: version: 1.0.74, author: Rank Math, Auto-updates disabled SVG Support: version: 2.3.19, author: Benbodhi, Auto-updates disabled WP Cloudflare Super Page Cache: version: 4.5.5, author: Optimole, Auto-updates disabled

wp-plugins-inactive (4)

AMP: version: 2.1.4, author: AMP Project Contributors, Auto-updates disabled Pods - Custom Content Types and Fields: version: 2.8.0, author: Pods Framework Team, Auto-updates disabled Statically: version: 1.2.1, author: Statically, Auto-updates disabled WP Mail SMTP: version: 3.1.0, author: WPForms, Auto-updates disabled

wp-media

image_editor: WP_Image_Editor_Imagick imagick_module_version: 1690 imagemagick_version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org imagick_version: 3.5.1 file_uploads: File uploads is turned off post_max_size: 80M upload_max_filesize: 80M max_effective_size: 80 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 122 MB imagick::RESOURCETYPE_DISK: 1073741824 imagick::RESOURCETYPE_FILE: 49152 imagick::RESOURCETYPE_MAP: 512 MB imagick::RESOURCETYPE_MEMORY: 256 MB imagick::RESOURCETYPE_THREAD: 1 imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, H, HALD, HDR, HEIC, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV gd_version: bundled (2.1.0 compatible) gd_formats: GIF, JPEG, PNG, WebP, BMP ghostscript_version: not available

wp-server

server_architecture: Linux 4.19.0-17-cloud-amd64 x86_64 httpd_software: nginx/1.21.3 php_version: 7.4.24 64bit php_sapi: fpm-fcgi max_input_variables: 1000 time_limit: 30 memory_limit: 512M max_input_time: 60 upload_max_filesize: 80M php_post_max_size: 80M curl_version: 7.64.0 OpenSSL/1.1.1d suhosin: false imagick_availability: true pretty_permalinks: true htaccess_extra_rules: true

wp-database

extension: mysqli server_version: 10.3.31-MariaDB client_version: mysqlnd 7.4.24

wp-constants

WP_HOME: http://www.devlaminteractie.nl/ WP_SITEURL: http://www.devlaminteractie.nl/ WP_CONTENT_DIR: /opt/bitnami/wordpress/wp-content WP_PLUGIN_DIR: /opt/bitnami/wordpress/wp-content/plugins WP_MEMORY_LIMIT: 40M WP_MAX_MEMORY_LIMIT: 512M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_LOCAL_DEV: undefined DB_CHARSET: utf8 DB_COLLATE: undefined

wp-filesystem

wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable

pods

pods-server-software: nginx/1.21.3 pods-user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0 pods-session-save-path: /opt/bitnami/php/var/run/session pods-session-save-path-exists: Yes pods-session-save-path-writable: Yes pods-session-max-lifetime: 1440 pods-opcode-cache-apc: No pods-opcode-cache-memcached: No pods-opcode-cache-opcache: Yes pods-opcode-cache-redis: No pods-object-cache-apc: No pods-object-cache-apcu: No pods-object-cache-memcache: No pods-object-cache-memcached: Yes pods-object-cache-redis: No pods-memory-current-usage: 13.441M pods-memory-current-usage-real: 16.000M pods-network-wide: No pods-install-location: /bitnami/wordpress/wp-content/plugins/pods-2.7.31/ pods-developer: No pods-tableless-mode: No pods-light-mode: No pods-strict: No pods-allow-deprecated: Yes pods-api-cache: Yes pods-shortcode-allow-evaluate-tags: No

`

Pods Package Export {"meta":{"version":"2.7.31","build":1634640811},"pods":{"46":{"id":46,"name":"functie","label":"functies","description":"","type":"taxonomy","storage":"meta","object":"","alias":"","fields":[],"show_in_menu":"1","label_singular":"functie","public":"1","show_ui":"1","hierarchical":"0","rewrite":"1","rewrite_with_front":"1","rewrite_hierarchical":"1","capability_type":"default","capability_type_custom":"functie","query_var":"0","sort":"0","built_in_post_types_ct_template":"0","built_in_post_types_custom_css":"0","built_in_post_types_customize_changeset":"0","built_in_post_types_oembed_cache":"0","built_in_post_types_page":"0","built_in_post_types_pfi":"1","built_in_post_types_post":"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":"0","show_tagcloud":"0","show_tagcloud_in_edit":"0","show_in_quick_edit":"0","show_admin_column":"0","pfat_enable":"0","pfat_append_single":"append","pfat_filter_single":"get_the_archive_description","rest_enable":"1","read_all":"1","write_all":"1","podType":{"name":"ct","label":"Custom Taxonomy"},"storageType":{"name":"meta","label":"Meta"},"built_in_post_types_wp_template":"0"},"21":{"id":21,"name":"pfi","label":"portfolio_items","description":"Port","type":"post_type","storage":"meta","object":"","alias":"","fields":{"tools":{"id":95,"name":"tools","label":"tools","description":"","help":"","class":"","type":"pick","weight":0,"pick_object":"taxonomy","pick_val":"tool","sister_id":"","post_status":"publish","required":"0","pick_format_type":"multi","pick_format_single":"autocomplete","pick_format_multi":"autocomplete","pick_display_format_multi":"default","pick_display_format_separator":", ","pick_allow_add_new":"1","pick_taggable":"1","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":[],"roles_allowed":[],"rest_pick_response":"array","rest_pick_depth":"1","rest_read":"1","rest_write":"1","unique":"0","pick_post_status":[],"admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"wat_ik_deed":{"id":96,"name":"wat_ik_deed","label":"wat ik deed","description":"","help":"","class":"","type":"pick","weight":1,"pick_object":"taxonomy","pick_val":"functie","sister_id":"-- Select One --","post_status":"publish","pick_table":"-- Select One --","required":"0","pick_format_type":"multi","pick_format_single":"dropdown","pick_format_multi":"autocomplete","pick_display_format_multi":"custom","pick_display_format_separator":", ","pick_allow_add_new":"1","pick_taggable":"1","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":"Administrator","roles_allowed":"administrator","rest_pick_depth":"1","rest_read":"1","rest_write":"1","unique":"0","pick_post_status":"publish","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""},"featured":{"id":49,"name":"featured","label":"featured","description":"featured","help":"","class":"","type":"boolean","weight":2,"pick_object":"","pick_val":"","sister_id":"","required":"0","pick_post_status":["publish"],"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"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"1","unique":"0"},"year":{"id":23,"name":"year","label":"year","description":"","help":"","class":"","type":"text","weight":3,"pick_object":"","pick_val":"","sister_id":"","required":"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","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":"1","unique":"0","text_repeatable":"0","text_placeholder":""},"organization":{"id":22,"name":"organization","label":"org","description":"","help":"","class":"","type":"text","weight":4,"pick_object":"","pick_val":"","sister_id":"","required":"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","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":"1","unique":"0","text_repeatable":"0","text_placeholder":""},"orgtype":{"id":44,"name":"orgtype","label":"Type organisatie","description":"","help":"","class":"","type":"text","weight":5,"pick_object":"","pick_val":"","sister_id":"","required":"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","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":"1","unique":"0","text_repeatable":"0","text_placeholder":""},"externurl":{"id":45,"name":"externurl","label":"extern url","description":"","help":"","class":"","type":"website","weight":6,"pick_object":"","pick_val":"","sister_id":"","required":"0","website_format":"no-http","website_allow_port":"0","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":"1","unique":"0","website_repeatable":"0","website_placeholder":""}},"show_in_menu":"1","label_singular":"portfolio_item","public":"1","show_ui":"1","supports_title":"1","supports_editor":"1","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"pfi","capability_type_extra":"1","has_archive":"1","has_archive_slug":"portfolio","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":"1","supports_excerpt":"0","supports_trackbacks":"0","supports_custom_fields":"1","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","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":"0","write_all":"0","built_in_taxonomies_functie":"1","built_in_taxonomies_tool":"1","podType":{"name":"cpt","label":"Custom Post Type"},"storageType":{"name":"meta","label":"Meta"},"menu_name":"Portfolio Item","menu_icon":"dashicons-portfolio","name_admin_bar":"Portfolio","built_in_taxonomies_wp_theme":"0"},"90":{"id":90,"name":"tool","label":"tools","description":"","type":"taxonomy","storage":"meta","object":"","alias":"","fields":[],"show_in_menu":1,"label_singular":"tool","public":"1","show_ui":"0","hierarchical":"0","rest_enable":"1","_migrated_28":"1","_locale":"user","podType":{"name":"ct","label":"Custom Taxonomy"},"storageType":{"name":"meta","label":"Meta"},"built_in_post_types_pfi":"1","rewrite":"1","rewrite_with_front":"0","rewrite_hierarchical":"0","capability_type":"default","write_all":"1","read_all":"1"}}}
pdclark commented 3 years ago

@sc0ttkclark Verified on all multi-relationship input types. Can't add new taxonomy through a taxonomy custom relationship field (in this example, tools).

sc0ttkclark commented 3 years ago

This might be related to #6175. I'll dig into it to see if I can determine the cause here.

sc0ttkclark commented 3 years ago

Add New modal for term form is broken and is not available until we add some hackaround solutions for the DOM handling it is going to need.

I've removed the pick_allow_add_new option for taxonomy objects for now since that was showing when it shouldn't have.

I've added pick_taggable support since luckily the react-select package supports an AsyncCreatableSelect component.

I've tested on my side to confirm that the taggable solution for autocomplete is working.

sc0ttkclark commented 3 years ago

Support for pick_taggable added via 4d5ed8c384ea96905c8417ac4983a91a14f2a8c2

sc0ttkclark commented 3 years ago

Related #6193