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

Pods Item List Block and WP 5.9 #6423

Open drikfan opened 2 years ago

drikfan commented 2 years ago

Description

It seems there is an error with the Pods Item List Block and Wordpress 5.9.

As soon as I start typing anything into the "Where" setting, I get a Wordpress SQL error. This does not happen using wordpress 5.8.3.

The Error: `[31-Jan-2022 00:57:37 UTC] WordPress database error Unknown column 't' in 'where clause' for query SELECT

            DISTINCT
            `t`.*
            FROM `wp_posts` AS `t`

            WHERE ( ( t ) AND ( `t`.`post_type` = 'arx-product' ) AND ( `t`.`post_status` IN ( 'publish' ) ) )

            ORDER BY `t`.`menu_order`, `t`.`post_title`, `t`.`post_date`
            LIMIT 0, 15 made by require('wp-admin/edit-form-blocks.php'), block_editor_rest_api_preload, array_reduce, rest_preload_api_request, rest_do_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WP_REST_Autosaves_Controller->get_items, WP_REST_Autosaves_Controller->prepare_item_for_response, WP_REST_Revisions_Controller->prepare_item_for_response, apply_filters('the_content'), WP_Hook->apply_filters, do_blocks, render_block, WP_Block->render, Pods\Whatsit\Block->render, Pods\Blocks\Types\Item_List->render, pods_shortcode, pods_shortcode_run, Pods->find, PodsData->select, pods_query, PodsData::query

`

Version

2.8.8.1

Testing Instructions

  1. Install wordpress 5.9 and pods plugin
  2. edit a page in the Gutenberg editor
  3. add pod item list to the page
  4. select a pod type to display
  5. start typing in the "Where" field

Screenshots / Screencast

No response

Possible Workaround

No response

Site Health Information

`
### wp-core ###

version: 5.9
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /%postname%/
https_status: false
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: local
user_count: 1
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /Users/derekfansler/Local Sites/arxunderstrapclone/app/public
wordpress_size: 46.72 MB (48993673 bytes)
uploads_path: /Users/derekfansler/Local Sites/arxunderstrapclone/app/public/wp-content/uploads
uploads_size: 261.07 KB (267336 bytes)
themes_path: /Users/derekfansler/Local Sites/arxunderstrapclone/app/public/wp-content/themes
themes_size: 129.57 MB (135863841 bytes)
plugins_path: /Users/derekfansler/Local Sites/arxunderstrapclone/app/public/wp-content/plugins
plugins_size: 11.70 MB (12265294 bytes)
database_size: 3.95 MB (4145152 bytes)
total_size: 192.20 MB (201535296 bytes)

### wp-active-theme ###

name: Ageless RX (arx-understrap)
version: 1.1.0
author: DF
author_website: (undefined)
parent_theme: Understrap (understrap)
theme_features: core-block-patterns, widgets-block-editor, automatic-feed-links, title-tag, menus, html5, post-thumbnails, customize-selective-refresh-widgets, post-formats, custom-background, custom-logo, responsive-embeds, editor-styles, align-wide, editor-color-palette, widgets, editor-style
theme_path: /Users/derekfansler/Local Sites/arxunderstrapclone/app/public/wp-content/themes/arx-understrap
auto_update: Disabled

### wp-parent-theme ###

name: Understrap (understrap)
version: 1.1.0
author: Howard Development & Consulting
author_website: https://howarddc.com
theme_path: /Users/derekfansler/Local Sites/arxunderstrapclone/app/public/wp-content/themes/understrap
auto_update: Disabled

### wp-themes-inactive (1) ###

Twenty Twenty-Two: version: 1.0, author: the WordPress team, Auto-updates disabled

### wp-plugins-active (1) ###

Pods - Custom Content Types and Fields: version: 2.8.8.1, author: Pods Framework Team, 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: 1000M
upload_max_filesize: 300M
max_effective_size: 300 MB
max_file_uploads: 20
gd_version: bundled (2.1.0 compatible)
gd_formats: GIF, JPEG, PNG, BMP
ghostscript_version: not available

### wp-server ###

server_architecture: Darwin 21.2.0 x86_64
httpd_software: nginx/1.16.0
php_version: 8.0.0 64bit
php_sapi: fpm-fcgi
max_input_variables: 4000
time_limit: 1200
memory_limit: 256M
max_input_time: 600
upload_max_filesize: 300M
php_post_max_size: 1000M
curl_version: 7.77.0 (SecureTransport) LibreSSL/2.8.3
suhosin: false
imagick_availability: false
pretty_permalinks: true
htaccess_extra_rules: false

### wp-database ###

extension: mysqli
server_version: 8.0.16
client_version: mysqlnd 8.0.0
max_allowed_packet: 16777216
max_connections: 151

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /Users/derekfansler/Local Sites/arxunderstrapclone/app/public/wp-content
WP_PLUGIN_DIR: /Users/derekfansler/Local Sites/arxunderstrapclone/app/public/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: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: local
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.16.0
pods-user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
pods-session-save-path: undefined
pods-session-save-path-exists: No
pods-session-save-path-writable: No
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: No
pods-object-cache-redis: No
pods-memory-current-usage: 5.098M
pods-memory-current-usage-real: 4.000M
pods-network-wide: No
pods-install-location: /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: No

`

Pods Package

{
    "meta": {
        "version": "2.8.8.1",
        "build": 1643591410
    },
    "pods": [
        {
            "name": "arx-product",
            "id": 39,
            "label": "ARX-Products",
            "description": "",
            "type": "post_type",
            "storage": "meta",
            "label_singular": "ARX-Product",
            "public": "1",
            "show_ui": "1",
            "rest_enable": "1",
            "supports_title": "1",
            "supports_editor": "1",
            "_migrated_28": "1",
            "required": "0",
            "pfat_enable": "1",
            "pfat_single": "arx-product-inline",
            "pfat_append_single": "prepend",
            "pfat_archive": "arx-product-inline",
            "pfat_append_archive": "prepend",
            "pfat_run_outside_loop": "0",
            "publicly_queryable": "1",
            "exclude_from_search": "0",
            "capability_type": "post",
            "capability_type_custom": "arx-product",
            "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",
            "revisions_to_keep_limit": "0",
            "delete_with_user": "1",
            "pfat_filter_single": "the_content",
            "pfat_filter_archive": "the_excerpt",
            "groups": [
                {
                    "name": "more_fields",
                    "id": 40,
                    "label": "More Fields",
                    "description": "",
                    "weight": 0,
                    "fields": [
                        {
                            "name": "product-name",
                            "id": 41,
                            "label": "Product Name",
                            "description": "",
                            "weight": 0,
                            "type": "text",
                            "sister_id": "-- Select One --",
                            "required": "1",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "text_trim": "1",
                            "rest_read": "1"
                        },
                        {
                            "name": "product-desc",
                            "id": 42,
                            "label": "Product Description",
                            "description": "",
                            "weight": 1,
                            "type": "wysiwyg",
                            "sister_id": "-- Select One --",
                            "required": "1",
                            "wysiwyg_editor": "tinymce",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1"
                        },
                        {
                            "name": "product-image",
                            "id": 43,
                            "label": "Image",
                            "description": "",
                            "weight": 2,
                            "type": "file",
                            "sister_id": "-- Select One --",
                            "required": "0",
                            "file_format_type": "single",
                            "file_uploader": "attachment",
                            "file_attachment_tab": "browse",
                            "file_upload_dir": "wp",
                            "file_edit_title": "1",
                            "file_show_edit_link": "0",
                            "file_linked": "0",
                            "file_limit": "0",
                            "file_type": "other",
                            "file_field_template": "rows",
                            "file_add_button": "Add File",
                            "file_modal_title": "Attach a file",
                            "file_modal_add_button": "Add File",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "rest_read": "1",
                            "file_allowed_extensions": "jpg,jpeg,png,gif,webp"
                        },
                        {
                            "name": "product-caption",
                            "id": 44,
                            "label": "Caption",
                            "description": "Caption for cta button",
                            "weight": 3,
                            "type": "wysiwyg",
                            "sister_id": "-- Select One --",
                            "required": "0",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "rest_read": "1",
                            "wysiwyg_editor": "quill",
                            "wysiwyg_editor_height": "32"
                        },
                        {
                            "name": "product-cta",
                            "id": 45,
                            "label": "CTA",
                            "description": "text for cta button",
                            "weight": 4,
                            "type": "text",
                            "sister_id": "-- Select One --",
                            "required": "0",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1"
                        },
                        {
                            "name": "product-link",
                            "id": 46,
                            "label": "Link",
                            "description": "Link to product",
                            "weight": 5,
                            "type": "pick",
                            "sister_id": "-- Select One --",
                            "post_status": [
                                "publish",
                                "draft",
                                "future"
                            ],
                            "required": "0",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "pick_object": "post_type",
                            "pick_val": "arx-product",
                            "pick_table": "-- Select One --",
                            "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": "Administrator",
                            "rest_read": "1"
                        }
                    ]
                }
            ]
        }
    ],
    "templates": [
        {
            "name": "arx-product-inline",
            "code": "<article class=\"arx-product\">\r\n    <header class=\"arx-product_header\">\r\n        <h3>{@product-name}<\/h3>\r\n        <hr\/>\r\n    <\/header>\r\n    <div class=\"arx-product_desc\">{@product-desc}<\/div>\r\n    <div class=\"arx-product_img\"><img src=\"{@product-image}\"><\/div>\r\n    <div class=\"arx-product_caption\">{@product-caption}<\/div>\r\n    <a class=\"arx-product_cta\" href=\"{@product-link}\">{@product-cta}<\/a>\r\n<\/article>",
            "id": 47,
            "_edit_last": "1",
            "_edit_lock": "1641580110:1",
            "pod_reference": {
                "pod": ""
            }
        }
    ]
}
sc0ttkclark commented 2 years ago

I'll check this out but the nature of instant previews in the Block Editor make entering things like this a challenge.

drikfan commented 2 years ago

Thanks Scott.

Just in case it helps at all Im running php 8. Ive tested using php 7.4.1 as well with the same result:

cobiadigital commented 2 years ago

Having this problem, as well. WP 5.9.1, PHP 7.4.27. Any ideas about a workaround?

drikfan commented 2 years ago

I ended up just writing my own custom data types and blocks and querying them - my project was simple enough that that was a quicker fix, sorry.