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

Shortcodes won't render via pods code syntax field #7319

Open Pezzab opened 5 months ago

Pezzab commented 5 months ago

Description

Shortcodes will not render using the code syntax field.

Update: there is also an issue if I try and embed the shortcode via the Pods Field Block - the form only renders while logged in but it is broken all the same.

Version

3.2.2

Testing Instructions

1: install WordPress with a default theme (I used 2021) 2: install Pods and eg WPForms plugin 3: create basic form and shortcode 4: extend post/pages with a new pod, add a code syntax field and switch shortcodes on 5: add the following code (or similar) to page.php before get_footer.php:


       <?php  $section = pods( 'page', get_the_ID() ); 

        $sections = $section->field( 'test_code_syntax_embed' ); ?>

        <div class="widget-area"><?php echo $sections ; ?><div>

6: add new page 7: add WPForm shortcode to post/page editor via shortcode block or Pods Field Value block 8: add shorcode to test code syntax custom field

Screenshots / Screencast

Result (note shortcode showing where second example of form should be):

image

Result if the Pods Field is embedded within the block editor logged out:

image

View when logged in:

image

View in edit screen:

image

View in edit screen of Pods Field Value method:

image

Possible Workaround

No response

Site Health Information

`
### wp-core ###

version: 6.5.5
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: C:\Users\username\Local Sites\shortcode-test\app\public
wordpress_size: 54.68 MB (57337609 bytes)
uploads_path: C:\Users\username\Local Sites\shortcode-test\app\public/wp-content/uploads
uploads_size: 5.62 MB (5890674 bytes)
themes_path: C:\Users\username\Local Sites\shortcode-test\app\public/wp-content/themes
themes_size: 16.06 MB (16842006 bytes)
plugins_path: C:\Users\username\Local Sites\shortcode-test\app\public/wp-content/plugins
plugins_size: 35.82 MB (37560519 bytes)
database_size: 2.69 MB (2818048 bytes)
total_size: 114.87 MB (120448856 bytes)

### wp-active-theme ###

name: Twenty Twenty-One (twentytwentyone)
version: 2.2
author: the WordPress team
author_website: https://wordpress.org/
parent_theme: none
theme_features: core-block-patterns, widgets-block-editor, automatic-feed-links, title-tag, post-formats, post-thumbnails, menus, html5, custom-logo, customize-selective-refresh-widgets, wp-block-styles, align-wide, editor-styles, editor-style, editor-font-sizes, custom-background, editor-color-palette, editor-gradient-presets, responsive-embeds, custom-line-height, link-color, custom-spacing, custom-units, widgets
theme_path: C:\Users\username\Local Sites\shortcode-test\app\public/wp-content/themes/twentytwentyone
auto_update: Disabled

### wp-themes-inactive (3) ###

Twenty Twenty-Four: version: 1.1, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Three: version: 1.4, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Two: version: 1.7, author: the WordPress team, Auto-updates disabled

### wp-plugins-active (2) ###

Pods - Custom Content Types and Fields: version: 3.2.2, author: Pods Framework Team, Auto-updates disabled
WPForms Lite: version: 1.8.9.2, author: WPForms, Auto-updates disabled

### wp-media ###

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1808
imagemagick_version: ImageMagick 7.1.0-18 Q16 x64 2021-12-14 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: 1
post_max_size: 1000M
upload_max_filesize: 300M
max_effective_size: 300 MB
max_file_uploads: 20
imagick_limits: 
    imagick::RESOURCETYPE_AREA: 16 GB
    imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
    imagick::RESOURCETYPE_FILE: 1536
    imagick::RESOURCETYPE_MAP: 16 GB
    imagick::RESOURCETYPE_MEMORY: 8 GB
    imagick::RESOURCETYPE_THREAD: 1
    imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CLIPBOARD, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DJVU, DNG, DOT, DPS, DPX, DXT1, DXT5, EMF, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLIF, FLV, FPX, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, 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, JXL, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, SCR, SCREENSHOT, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, YAML, YCbCr, YCbCrA, YUV
gd_version: bundled (2.1.0 compatible)
gd_formats: GIF, JPEG, PNG, WebP, BMP, AVIF, XPM
ghostscript_version: not available

### wp-server ###

server_architecture: Windows NT 10.0 AMD64
httpd_software: nginx/1.16.0
php_version: 8.1.23 64bit
php_sapi: cgi-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 OpenSSL/1.1.1t
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: false
current: 2024-06-26T14:56:04+00:00
utc-time: Wednesday, 26-Jun-24 14:56:04 UTC
server-time: 2024-06-26T14:56:02+00:00

### wp-database ###

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

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: C:\Users\username\Local Sites\shortcode-test\app\public/wp-content
WP_PLUGIN_DIR: C:\Users\username\Local Sites\shortcode-test\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
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8
DB_COLLATE: undefined

### wp-filesystem ###

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

### pods ###

pods-version: 3.2.2
pods-first-version: 3.2.2
pods-last-version: 3.2.2
pods-server-software: nginx/1.16.0
pods-user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0
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: 6.770M / 40M
pods-memory-current-usage-real: 8.000M
pods-network-wide: No
pods-install-location: C:\Users\username\Local Sites\shortcode-test\app\public\wp-content\plugins\pods/
pods-developer: No
pods-tableless-mode: No
pods-relationship-table-enabled: Yes
pods-relationship-table-status: 0
pods-light-mode: No
pods-strict: No
pods-allow-deprecated: Yes
pods-api-cache: Yes
pods-shortcode-allow-evaluate-tags: No
pods-can-use-sessions: No
pods-settings-types_only: Enable [types_only=0]
pods-settings-watch_changed_fields: Disable [watch_changed_fields=0]
pods-settings-metadata_integration: Disable [metadata_integration=0]
pods-settings-metadata_override_get: Disable [metadata_override_get=0]
pods-settings-register_meta_integration: Disable [register_meta_integration=0]
pods-settings-media_modal_fields: Enable [media_modal_fields=0]
pods-settings-session_auto_start: Disable [session_auto_start=0]
pods-settings-dynamic_features_allow: Enable [dynamic_features_allow=1]
pods-settings-dynamic_features_enabled: Display and Form [dynamic_features_enabled=display,form]
pods-settings-show_access_restricted_messages: Disable [show_access_restricted_messages=0]
pods-settings-show_access_admin_notices: Enable [show_access_admin_notices=1]
pods-settings-dynamic_features_allow_sql_clauses: Disable [dynamic_features_allow_sql_clauses=0]
pods-settings-display_callbacks: Customized [display_callbacks=customized]
pods-settings-display_callbacks_allowed: esc_attr,esc_html

### wpforms ###

version: 1.8.9.2
lite: June 26, 2024 at 2:07 pm
upload_dir: Writable
total_forms: 1
total_submissions: undefined

`

Pods Package

{
    "@meta": {
        "version": "3.2.2",
        "build": 1719413820
    },
    "settings": {
        "types_only": "0",
        "watch_changed_fields": "0",
        "metadata_integration": "0",
        "metadata_override_get": "0",
        "register_meta_integration": "0",
        "media_modal_fields": "0",
        "session_auto_start": "0",
        "dynamic_features_allow": "1",
        "dynamic_features_enabled": [
            "display",
            "form"
        ],
        "show_access_restricted_messages": "0",
        "show_access_admin_notices": "1",
        "dynamic_features_allow_sql_clauses": "0",
        "display_callbacks": "customized",
        "display_callbacks_allowed": "esc_attr,esc_html",
        "wisdom_opt_out": "1",
        "active_components": [
            "migrate-packages",
            "templates"
        ]
    },
    "pods": [
        {
            "name": "page",
            "id": 9,
            "label": "Pages",
            "description": "",
            "type": "post_type",
            "storage": "meta",
            "object": "page",
            "_migrated_28": "1",
            "dynamic_features_allow": "inherit",
            "restrict_dynamic_features": "1",
            "restricted_dynamic_features": [
                "form",
                "display"
            ],
            "restricted_dynamic_features_forms": [
                "edit",
                "add"
            ],
            "show_access_restricted_messages": "inherit",
            "show_access_admin_notices": "inherit",
            "groups": [
                {
                    "name": "more_fields",
                    "id": 10,
                    "label": "More Fields",
                    "description": "",
                    "weight": 0,
                    "fields": [
                        {
                            "name": "test_code_syntax_embed",
                            "id": 11,
                            "label": "Test code syntax embed",
                            "description": "",
                            "weight": 0,
                            "type": "code",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "revisions_revision_field": "0",
                            "enable_conditional_logic": "0",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "required": "0",
                            "code_max_length": "-1",
                            "logged_in_only": "0",
                            "admin_only": "0",
                            "restrict_role": "0",
                            "restrict_capability": "0",
                            "hidden": "0",
                            "read_only": "0",
                            "code_trim": "1",
                            "code_trim_lines": "0",
                            "code_trim_p_brs": "0",
                            "code_trim_extra_lines": "0",
                            "code_sanitize_html": "1",
                            "code_allow_shortcode": "1"
                        },
                        {
                            "name": "test_html_embed",
                            "id": 12,
                            "label": "Test HTML embed",
                            "description": "",
                            "weight": 1,
                            "type": "html",
                            "html_no_label": "1",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "revisions_revision_field": "0",
                            "enable_conditional_logic": "0",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "required": "0",
                            "html_trim": "1",
                            "html_trim_lines": "0",
                            "html_trim_p_brs": "0",
                            "html_trim_extra_lines": "0",
                            "html_oembed": "0",
                            "html_wptexturize": "1",
                            "html_convert_chars": "1",
                            "html_wpautop": "1",
                            "html_allow_shortcode": "1"
                        }
                    ]
                }
            ]
        }
    ]
}
Pezzab commented 3 months ago

I guess this is a pretty niche issue but it has seriously messed up the functionality of an existing site.

Just an update, I've updated all plugins and only have essential plugins running on my test site. This WPForms shortcode embed displays some form elements but it has an error message saying to enable javascript to get it working:

image