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

Error when {@permalink} is used in a template in combination with a tablebased custom taxonomy #7073

Open mkjuergen opened 1 year ago

mkjuergen commented 1 year ago

Description

Even if I could figure out very clear, what this is all about, there happend some mysterious thinks in the database. I did this 3 times. At the frist time I created 6 different values, but only 2 of them appeared in the extra table. Only those two raised the error. So I thought it depends somehow on the casting in php, as 0, 1, 9 and true might be rated as number or boolean. confusing tables no 1

Next I tried to find out if the interface makes the difference and added "an other string" inside the editor by the panel. This worked. Totally confused I started from scratch.

In the next round all items had their related entries. I found out that the magic tag {@permalink} was the reason. This was working correctly in the metabased version. So I started not only from scratch but with a clean installation under a other domain and database (all on the same server).

That's the one I present know. All tables, values and realtion look good. Permlink is on strike.

Fatal error: Uncaught Error: Object of class WP_Error could not be converted to string in .../wordpress/pods/wp-content/plugins/pods/classes/Pods.php:4279

Pls log in for the stack trace. I do not want to have any development public.

Version

2.9.13

Testing Instructions

You can log in to this staging site which I have build just for that reason. Log In Pls do a password reset for scott@pods.io

I have created the same situation as "metabased" and "tablebase". Everything is well documented inside and should be self-explanatory.

Screenshots / Screencast

Demo Meta Based – Pods Playground.pdf Demo Table Based_ simple – Pods Playground.pdf Demo Table Based_ slug clone – Pods Playground.pdf Demo Table Based_ unchecked – Pods Playground.pdf Edit Demo “Demo Table Based_ permalink error” ‹ Pods Playground — WordPress.pdf

Possible Workaround

1 do not use tablebased custom taxonomy ;-)

2 create a custom slug and adjust the template for the rewrited URL

Site Health Information

`
### wp-core ###

version: 6.2
site_language: en_US
user_language: en_US
timezone: Europe/Vienna
permalink: /%postname%/
https_status: false
multisite: false
user_registration: 0
blog_public: 0
default_comment_status: open
environment_type: staging
user_count: 2
dotorg_communication: true

### wp-paths-sizes ###

deleted by author

### wp-active-theme ###

name: Hello Elementor (hello-elementor)
version: 2.7.1
author: Elementor Team
author_website: https://elementor.com/?utm_source=wp-themes&utm_campaign=author-uri&utm_medium=wp-dash
parent_theme: none
theme_features: core-block-patterns, widgets-block-editor, menus, post-thumbnails, automatic-feed-links, title-tag, html5, custom-logo, editor-style, align-wide, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider
theme_path: /kunden/381371_1220/webseiten/basic.websiteservices.at/wordpress/pods/wp-content/themes/hello-elementor
auto_update: Disabled

### wp-themes-inactive (6) ###

GeneratePress: version: 3.3.0, author: Tom Usborne, Auto-updates disabled
jk_raw: version: 1.0.0, author: Underscores.me, Auto-updates disabled
Neve: version: 3.5.6, author: ThemeIsle (latest version: 3.5.8), Auto-updates disabled
Page Builder Framework: version: 2.10.3, author: David Vongries, Auto-updates disabled
Royal Elementor Kit: version: 1.0.99, author: WP Royal (latest version: 1.0.104), Auto-updates disabled
Twenty Twenty-Three: version: 1.1, author: the WordPress team, Auto-updates disabled

### wp-mu-plugins (2) ###

0-ninjafirewall.php: version: 1.0, author: The Ninja Technologies Network
WP STAGING Optimizer: version: 1.5.1, author: René Hermenau

### wp-plugins-active (5) ###

Disable Comments: version: 2.4.3, author: WPDeveloper, Auto-updates disabled
Duplicate Page: version: 4.5.2, author: mndpsingh287, Auto-updates disabled
NinjaFirewall (WP Edition): version: 4.5.7, author: The Ninja Technologies Network, Auto-updates disabled
Pods - Custom Content Types and Fields: version: 2.9.13, author: Pods Framework Team, Auto-updates disabled
WP STAGING PRO - Backup Duplicator & Migration: version: 4.8.1, author: WP-STAGING, Auto-updates disabled

### wp-plugins-inactive (2) ###

Classic Editor: version: 1.6.3, author: WordPress Contributors, Auto-updates disabled
Pods Alternative Cache: version: 2.1.7, author: Pods Framework Team, Auto-updates disabled

### wp-media ###

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1692
imagemagick_version: ImageMagick 6.9.12-86 Q16 x86_64 17814 https://legacy.imagemagick.org
imagick_version: 3.7.0
file_uploads: File uploads is turned off
post_max_size: 75M
upload_max_filesize: 50M
max_effective_size: 50 MB
max_file_uploads: 20
imagick_limits: 
    imagick::RESOURCETYPE_AREA: 117 GB
    imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
    imagick::RESOURCETYPE_FILE: 786432
    imagick::RESOURCETYPE_MAP: 59 GB
    imagick::RESOURCETYPE_MEMORY: 29 GB
    imagick::RESOURCETYPE_THREAD: 1
    imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, 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, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, 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, POCKETMOD, 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, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.27

### wp-server ###

server_architecture: Linux 3.10.0-1160.88.1.el7.x86_64 x86_64
httpd_software: Apache
php_version: 8.0.28 64bit
php_sapi: fpm-fcgi
max_input_variables: 1500
time_limit: 120
memory_limit: 256M
max_input_time: 60
upload_max_filesize: 50M
php_post_max_size: 75M
curl_version: 7.61.1 OpenSSL/1.1.1k
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: false

### wp-database ###

extension: mysqli
server_version: 10.4.28-MariaDB
client_version: mysqlnd 8.0.28
max_allowed_packet: 64000000
max_connections: 400

### wp-constants ###

WP_HOME: deleted by author
WP_SITEURL: deleted by author
WP_CONTENT_DIR: .../pods/wp-content
WP_PLUGIN_DIR: .../pods/wp-content/plugins
WP_MEMORY_LIMIT: 256M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: true
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: staging
DB_CHARSET: utf8mb4
DB_COLLATE: undefined

### wp-filesystem ###

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

### pods ###

pods-server-software: Apache
pods-user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 OPR/98.0.0.0
pods-session-save-path: deleted by author
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: Yes
pods-object-cache-memcache: No
pods-object-cache-memcached: Yes
pods-object-cache-redis: Yes
pods-memory-current-usage: 46.869M
pods-memory-current-usage-real: 48.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: Yes
pods-relationship-table-status: 26

`

Pods Package

{
    "@meta": {
        "version": "2.9.13",
        "build": 1684160204
    },
    "settings": {
        "types_only": "0",
        "watch_changed_fields": "0",
        "metadata_integration": "1",
        "metadata_override_get": "1",
        "session_auto_start": "0",
        "wisdom_opt_out": "1"
    },
    "pods": [
        {
            "name": "demo",
            "id": 404,
            "label": "Demos",
            "description": "",
            "type": "post_type",
            "storage": "meta",
            "label_singular": "Demo",
            "public": "1",
            "show_ui": "1",
            "rest_enable": "1",
            "supports_title": "1",
            "supports_editor": "1",
            "_migrated_28": "1",
            "built_in_taxonomies_meta_taxonomy": "1",
            "meta_box_context": "normal",
            "meta_box_priority": "default",
            "required": "0",
            "required_help_boolean": "0",
            "publicly_queryable": "1",
            "exclude_from_search": "0",
            "capability_type": "post",
            "capability_type_custom": "demo",
            "capability_type_extra": "1",
            "has_archive": "0",
            "hierarchical": "0",
            "can_export": "1",
            "rewrite": "0",
            "rewrite_with_front": "1",
            "rewrite_feeds": "0",
            "rewrite_pages": "1",
            "query_var": "0",
            "default_status": "draft",
            "revisions_to_keep_limit": "0",
            "delete_with_user": "1",
            "built_in_taxonomies_table_taxonomy": "1",
            "groups": [
                {
                    "name": "meta_taxonomy-group",
                    "id": 405,
                    "label": "Meta Taxonomy",
                    "description": "",
                    "weight": 0,
                    "meta_box_priority": "default",
                    "roles_allowed": "administrator",
                    "meta_box_context": "normal",
                    "fields": [
                        {
                            "name": "meta_taxonomy-relation",
                            "id": 409,
                            "label": "Meta Taxonomy",
                            "description": "",
                            "weight": 0,
                            "type": "pick",
                            "sister_id": "408",
                            "required": "0",
                            "required_help_boolean": "0",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "pick_object": "taxonomy",
                            "pick_val": "meta_taxonomy",
                            "pick_table": "-- Select One --",
                            "pick_format_type": "multi",
                            "pick_format_single": "dropdown",
                            "pick_format_multi": "checkbox",
                            "pick_display_format_multi": "custom",
                            "pick_display_format_separator": "<br>",
                            "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",
                            "pick_post_status": "publish",
                            "pick_post_author": "0"
                        }
                    ]
                },
                {
                    "name": "table_taxonomy-group",
                    "id": 430,
                    "label": "Table Taxonomy",
                    "description": "",
                    "weight": 1,
                    "meta_box_context": "normal",
                    "meta_box_priority": "default",
                    "roles_allowed": "administrator",
                    "fields": [
                        {
                            "name": "table_taxonomy-relation",
                            "id": 431,
                            "label": "Table Taxonomy",
                            "description": "",
                            "weight": 0,
                            "type": "pick",
                            "pick_object": "taxonomy",
                            "sister_id": "434",
                            "pick_table": "-- Select One --",
                            "required": "0",
                            "required_help_boolean": "0",
                            "pick_format_type": "multi",
                            "pick_format_single": "dropdown",
                            "pick_format_multi": "checkbox",
                            "pick_display_format_multi": "custom",
                            "pick_display_format_separator": "<br>",
                            "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",
                            "pick_post_status": "publish",
                            "pick_post_author": "0",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "pick_val": "table_taxonomy"
                        }
                    ]
                }
            ]
        },
        {
            "name": "meta_taxonomy",
            "id": 406,
            "label": "Meta Taxonomies",
            "description": "",
            "type": "taxonomy",
            "storage": "meta",
            "label_singular": "Meta Taxonomy",
            "public": "1",
            "show_ui": "1",
            "hierarchical": "1",
            "rest_enable": "1",
            "_migrated_28": "1",
            "built_in_post_types_demo": "1",
            "required": "0",
            "required_help_boolean": "0",
            "rewrite": "1",
            "rewrite_with_front": "1",
            "rewrite_hierarchical": "1",
            "capability_type": "default",
            "capability_type_custom": "meta_taxonomy",
            "query_var": "0",
            "sort": "0",
            "rewrite_custom_slug": "my_meta",
            "groups": [
                {
                    "name": "more_fields",
                    "id": 407,
                    "label": "More Fields",
                    "description": "",
                    "weight": 0,
                    "fields": [
                        {
                            "name": "demo-meta_taxonomy",
                            "id": 408,
                            "label": "Demo",
                            "description": "",
                            "weight": 0,
                            "type": "pick",
                            "pick_object": "post_type",
                            "pick_val": "demo",
                            "sister_id": "409",
                            "pick_table": "-- Select One --",
                            "required": "0",
                            "required_help_boolean": "0",
                            "pick_format_type": "multi",
                            "pick_format_single": "dropdown",
                            "pick_format_multi": "checkbox",
                            "pick_display_format_multi": "custom",
                            "pick_display_format_separator": "<br>",
                            "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",
                            "pick_post_status": "publish",
                            "pick_post_author": "0",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1"
                        }
                    ]
                }
            ]
        },
        {
            "name": "post",
            "id": 402,
            "label": "Post",
            "description": "",
            "type": "post_type",
            "storage": "meta",
            "object": "post",
            "_migrated_28": "1",
            "built_in_taxonomies_meta_taxonomy": "0",
            "groups": [
                {
                    "name": "more_fields",
                    "id": 403,
                    "label": "More Fields",
                    "description": "",
                    "weight": 0,
                    "fields": []
                }
            ]
        },
        {
            "name": "table_taxonomy",
            "id": 432,
            "label": "Table Taxonomies",
            "description": "",
            "type": "taxonomy",
            "storage": "table",
            "label_singular": "Table Taxonomy",
            "public": "1",
            "show_ui": "1",
            "hierarchical": "1",
            "rest_enable": "1",
            "_migrated_28": "1",
            "show_in_menu": "1",
            "menu_location": "default",
            "show_in_nav_menus": "1",
            "show_tagcloud": "1",
            "show_in_quick_edit": "1",
            "built_in_post_types_demo": "1",
            "rewrite": "1",
            "rewrite_custom_slug": "my_table",
            "capability_type": "default",
            "rewrite_with_front": "1",
            "rewrite_hierarchical": "1",
            "required": "0",
            "required_help_boolean": "0",
            "unique": "0",
            "groups": [
                {
                    "name": "more_fields",
                    "id": 433,
                    "label": "More Fields",
                    "description": "",
                    "weight": 0,
                    "fields": [
                        {
                            "name": "demo-table_taxonomy",
                            "id": 434,
                            "label": "Demo",
                            "description": "",
                            "weight": 0,
                            "type": "pick",
                            "pick_object": "post_type",
                            "pick_val": "demo",
                            "sister_id": "431",
                            "pick_table": "-- Select One --",
                            "required": "0",
                            "required_help_boolean": "0",
                            "unique": "0",
                            "pick_format_type": "multi",
                            "pick_format_single": "dropdown",
                            "pick_format_multi": "checkbox",
                            "pick_display_format_multi": "custom",
                            "pick_display_format_separator": "<br>",
                            "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",
                            "pick_post_status": "publish",
                            "pick_post_author": "0",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1"
                        },
                        {
                            "name": "slug_clone",
                            "id": 459,
                            "label": "Slug Clone",
                            "description": "",
                            "weight": 1,
                            "type": "text",
                            "sister_id": "-- Select One --",
                            "required": "0",
                            "required_help_boolean": "0",
                            "unique": "0",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1"
                        }
                    ]
                }
            ]
        }
    ],
    "templates": [
        {
            "name": "Meta List",
            "code": "<ul>\r\n\t[each meta_taxonomy-relation]\r\n\t\t<li><a href=\"{@permalink}\">{@name}<\/a><br>\r\n            {@description}\r\n        <\/li>\r\n\t[\/each]\r\n<\/ul>",
            "id": 419,
            "_edit_lock": "1684155662:1",
            "_edit_last": "1",
            "admin_only": "0",
            "restrict_capability": "0",
            "show_restrict_message": "0",
            "_pods_capability_allowed": [
                ""
            ],
            "pod_reference": {
                "pod": "demo"
            }
        },
        {
            "name": "Table List",
            "code": "<ul>\r\n\t[each table_taxonomy-relation]\r\n\t\t<li><a href=\"{@permalink}\">{@name}<\/a><br>\r\n            {@description}\r\n        <\/li>\r\n\t[\/each]\r\n<\/ul>",
            "id": 443,
            "_edit_lock": "1684156789:1",
            "_edit_last": "1",
            "pod_reference": {
                "pod": "demo"
            },
            "admin_only": "0",
            "restrict_capability": "0",
            "show_restrict_message": "0",
            "_pods_capability_allowed": [
                ""
            ]
        },
        {
            "name": "Table List Simple",
            "code": "<ul>\r\n\t[each table_taxonomy-relation]\r\n\t\t<li><a href=\"#\">{@name}<\/a><br>\r\n            {@description}\r\n        <\/li>\r\n\t[\/each]\r\n<\/ul>",
            "id": 447,
            "_edit_last": "1",
            "admin_only": "0",
            "restrict_capability": "0",
            "show_restrict_message": "0",
            "_pods_capability_allowed": [
                ""
            ],
            "_edit_lock": "1684155970:1",
            "pod_reference": {
                "pod": ""
            }
        },
        {
            "name": "Table List Slug Clone",
            "code": "<ul>\r\n\t[each table_taxonomy-relation]\r\n\t\t<li><a href=\"my_table\/{@slug_clone}\">{@name}<\/a><br>\r\n            {@description}\r\n        <\/li>\r\n\t[\/each]\r\n<\/ul>",
            "id": 460,
            "_edit_lock": "1684158419:1",
            "_edit_last": "1",
            "admin_only": "0",
            "restrict_capability": "0",
            "show_restrict_message": "0",
            "_pods_capability_allowed": [
                ""
            ],
            "_wp_old_slug": "table-list-copy",
            "pod_reference": {
                "pod": "demo"
            }
        }
    ]
}
mwf1 commented 1 year ago

Looks similar to Pods Item List block cannot display {@permalink} magic tag for table-storage custom taxonomy #7059