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

Advanced Relationships Database Table SQL Error #6223

Closed preston-lloyd closed 2 years ago

preston-lloyd commented 2 years ago

Description

Advanced relationships with database tables not created with the Advanced Content Types results in an SQL error. This was working in the past but seems to have broken in a recent release. The relationship seems to ignore what is set for the Table Index Column and default to "name".

Testing instructions

  1. Install the Advanced Relationships component
  2. Create Pod
  3. Create a Database Tables Relationship for a database table that doesn't have a "name" column. (I tried tables created by WooCommerce, Formidable Forms, H5P and creating my own table"
  4. Attempt to create a new Pod, the error shows up where the dropdown is supposed to be.

Expected behavior

The Table Index Column should use the column specified.

Screenshots / screencast

relationship-options

error

Possible workaround

None found yet.

Pods version

Version 2.8.1

Other super helpful information

WordPress Environment ` ### wp-core ### version: 5.8.1 site_language: en_US user_language: en_US timezone: +00:00 permalink: /%postname%/ https_status: true multisite: false user_registration: 0 blog_public: 1 default_comment_status: open environment_type: production user_count: 2 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /var/www/html wordpress_size: 67.96 MB (71265391 bytes) uploads_path: /var/www/html/wp-content/uploads uploads_size: 1.59 GB (1712052189 bytes) themes_path: /var/www/html/wp-content/themes themes_size: 67.68 MB (70972088 bytes) plugins_path: /var/www/html/wp-content/plugins plugins_size: 217.99 MB (228578219 bytes) database_size: 94.03 MB (98598912 bytes) total_size: 2.03 GB (2181466799 bytes) ### wp-dropins (1) ### advanced-cache.php: true ### wp-active-theme ### name: Fluid22 (fluid22) version: 1.0.0 author: Fluid22 author_website: https://fluid22.com parent_theme: Astra (astra) theme_features: core-block-patterns, woocommerce, astra_hooks, widgets-block-editor, align-wide, automatic-feed-links, title-tag, post-thumbnails, html5, post-formats, custom-logo, customize-selective-refresh-widgets, editor-style, rank-math-breadcrumbs, amp, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, fl-theme-builder-headers, fl-theme-builder-footers, fl-theme-builder-parts, widgets, menus theme_path: /var/www/html/wp-content/themes/fluid22 auto_update: Disabled ### wp-parent-theme ### name: Astra (astra) version: 3.6.7 (latest version: 3.7.3) author: Brainstorm Force author_website: https://wpastra.com/about/ theme_path: /var/www/html/wp-content/themes/astra auto_update: Disabled ### wp-themes-inactive (7) ### Allegiant: version: 1.2.7, author: CPOThemes, Auto-updates disabled Ascendant: version: 0.7, author: CPOThemes, Auto-updates disabled DFD Ronneby: version: 3.2.8, author: DFD, Auto-updates disabled MagazineBook: version: 1.0.9, author: OdieThemes, Auto-updates disabled Travel Master: version: 1.1.7, author: Theme Palace (latest version: 1.1.8), Auto-updates disabled Twenty Twenty: version: 1.8, author: the WordPress team, Auto-updates disabled Twenty Twenty-One: version: 1.4, author: the WordPress team, Auto-updates disabled ### wp-plugins-active (26) ### Astra Pro: version: 2.7.3, author: Brainstorm Force, Auto-updates disabled Beaver Builder Plugin (Agency Version): version: 2.5.0.2, author: The Beaver Builder Team, Auto-updates disabled Beaver Themer: version: 1.3.3.1, author: The Beaver Builder Team, Auto-updates disabled Custom Adobe Fonts (Typekit): version: 1.0.18, author: Brainstorm Force, Auto-updates disabled Custom Fonts: version: 1.3.3, author: Brainstorm Force, Auto-updates disabled Disable Right Click For WP: version: 1.1.6, author: Aftab Muni, Auto-updates disabled Formidable Forms: version: 5.0.09, author: Strategy11, Auto-updates disabled Formidable Forms Pro: version: 5.0.09, author: Strategy11, Auto-updates disabled Formidable Visual Views: version: 5.1.04, author: Strategy11, Auto-updates disabled GA Google Analytics: version: 20210719, author: Jeff Starr, Auto-updates disabled H5P: version: 1.15.3, author: Joubel, Auto-updates disabled Header Footer Code Manager: version: 1.1.14, author: 99robots, Auto-updates disabled Pods - Custom Content Types and Fields: version: 2.8.1, author: Pods Framework Team, Auto-updates disabled Pods Beaver Themer Add-On: version: 1.3.6, author: Quasel, Pods Framework Team, Auto-updates disabled PowerPack for Beaver Builder: version: 2.18.2, author: IdeaBox Creations, Auto-updates disabled Search & Filter: version: 1.2.14, author: Code Amp, Auto-updates disabled SEOPress: version: 5.1.0, author: SEOPress, Auto-updates disabled SEOPress PRO: version: 5.1.0, author: SEOPress, Auto-updates disabled Smush: version: 3.9.1, author: WPMU DEV, Auto-updates disabled Stream: version: 3.8.2, author: XWP, Auto-updates disabled Ultimate Addons for Beaver Builder: version: 1.28.10, author: Brainstorm Force, Auto-updates disabled WooCommerce: version: 5.8.0, author: Automattic, Auto-updates disabled WooCommerce Stripe Gateway: version: 5.7.0, author: WooCommerce, Auto-updates disabled Wordfence Security: version: 7.5.6, author: Wordfence, Auto-updates disabled WordPress Backup & Security Plugin - BlogVault: version: 4.64, author: Backup by BlogVault, Auto-updates disabled WP Rocket: version: 3.10.1, author: WP Media, Auto-updates disabled ### wp-plugins-inactive (3) ### Intuitive Custom Post Order: version: 3.1.3, author: hijiri, Auto-updates disabled UpdraftPlus - Backup/Restore: version: 1.16.62, author: UpdraftPlus.Com, DavidAnderson, Auto-updates disabled WP fail2ban: version: 4.3.0.9, author: Charles Lecklider, Auto-updates disabled ### wp-media ### image_editor: WP_Image_Editor_GD imagick_module_version: Not available imagemagick_version: Not available imagick_version: Not available file_uploads: File uploads is turned off post_max_size: 64M upload_max_filesize: 64M max_effective_size: 64 MB max_file_uploads: 20 gd_version: 2.3.0 gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: not available ### wp-server ### server_architecture: Linux 5.4.0-84-generic x86_64 httpd_software: Apache/2.4.41 (Ubuntu) php_version: 7.4.23 64bit php_sapi: fpm-fcgi max_input_variables: 1000 time_limit: 30 memory_limit: 128M admin_memory_limit: 256M max_input_time: 60 upload_max_filesize: 64M php_post_max_size: 64M curl_version: 7.68.0 OpenSSL/1.1.1f suhosin: false imagick_availability: false pretty_permalinks: true htaccess_extra_rules: true ### wp-database ### extension: mysqli server_version: 8.0.25 client_version: mysqlnd 7.4.23 ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /var/www/html/wp-content WP_PLUGIN_DIR: /var/www/html/wp-content/plugins WP_MEMORY_LIMIT: 40M WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: true 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: Apache/2.4.41 (Ubuntu) pods-user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 pods-session-save-path: /var/lib/php/sessions pods-session-save-path-exists: Yes pods-session-save-path-writable: Yes pods-session-max-lifetime: 1440 pods-opcode-cache-apc: Yes pods-opcode-cache-memcached: No pods-opcode-cache-opcache: Yes pods-opcode-cache-redis: No pods-object-cache-apc: Yes pods-object-cache-apcu: Yes pods-object-cache-memcache: No pods-object-cache-memcached: No pods-object-cache-redis: No pods-memory-current-usage: 30.638M pods-memory-current-usage-real: 16.000M pods-network-wide: No pods-install-location: /var/www/html/wp-content/plugins/pods/ pods-developer: No pods-tableless-mode: No pods-relationship-table-enabled: Yes pods-light-mode: No pods-strict: No pods-allow-deprecated: Yes pods-api-cache: Yes pods-shortcode-allow-evaluate-tags: No pods-sessions: Disable sessions pods-can-use-sessions: Yes `
Pods Package Export { "meta": { "version": "2.8.1", "build": 1634927005 }, "pods": [ { "name": "product", "id": 4456, "label": "Product", "description": "", "type": "post_type", "storage": "meta", "object": "product", "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": "0", "read_all": "0", "write_all": "0", "built_in_taxonomies_topic": "1", "_migrated_28": "1", "groups": [ { "name": "more_fields", "id": 6419, "label": "More Fields", "description": "", "weight": 0, "fields": [ { "name": "game", "id": 4585, "label": "Game", "description": "", "weight": 0, "type": "pick", "pick_object": "table", "pick_table": "wp_h5p_contents", "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": "0", "pick_show_view_link": "0", "pick_limit": "0", "pick_table_id": "id", "pick_table_index": "id", "pick_display": "title", "pick_user_role": "Administrator", "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", "pick_val": "wp_h5p_contents", "unique": "0", "post_status": "publish", "sister_id": "-- Select One --" } ] } ] } ] }
sc0ttkclark commented 2 years ago

This may be fixed in https://github.com/pods-framework/pods/tree/release/2.8.2 already, can you confirm?

preston-lloyd commented 2 years ago

I tested with that release, it's still broken. The error message changed, see below: Capture

sc0ttkclark commented 2 years ago

I just made another tweak in 4824da2c2141d2c37cdf5feeb69d3dda95d39a6d after I saw your specific error.

I'm going to look at this further on my side to retest it but that should resolve it now.

sc0ttkclark commented 2 years ago

Tested and confirmed fix after this additional tweaks: 2a45e26ed049f755f0a7cdca1f85caad85af7614