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

[before] & [after] not working after upgrade to version 2.8.3 #6298

Open guille110187 opened 2 years ago

guille110187 commented 2 years ago

Description

after I upgrade to version 2.8.3 [before] and [after they] stopped working

Testing instructions

This is my code

[if approvals]
[before]<table class="product_table" id="table_product"><tbody>[/before]
[each approvals]
        <tr>
            <td>
            <h4>{@post_excerpt}</h4>
            </td>
            <td>{@_img.medium}</td>
        </tr>   
[/each]
[after]</tbody></table>[/after]
[/if]

Screenshots / screencast

image

Pods version

2.8.3

Other super helpful information

WordPress Environment ``` Copy and paste your Tools > Site Health > Info. Use the 'Copy Site Info to Clipboard' and paste the results over this line. ```
Pods Package Export ```json Copy and paste your Pods Admin > Migrate: Packages > Export and paste the code over this line. ```
sc0ttkclark commented 2 years ago

Can you provide a package of your configuration (Pods Admin > Migrate Packages) using the Migrate Packages component (Pods Admin > Components)? That might help us to see if we can reproduce the issue.

Also helpful would be access to your Site Health information (Tools > Site Health > Info Tab > Copy site info to clipboard) would also help us determine if there are any potential conflicts from other plugins or your theme.

guille110187 commented 2 years ago

Hi,

Attached the configuration.

`

wp-core

version: 5.8.2 site_language: en_US user_language: en_US timezone: -04:00 permalink: /%postname%/ https_status: false multisite: false user_registration: 1 blog_public: 1 default_comment_status: undefined environment_type: production user_count: 2 dotorg_communication: true

wp-paths-sizes

wordpress_path: /opt/bitnami/apps/wordpress/htdocs wordpress_size: 425.39 MB (446052846 bytes) uploads_path: /opt/bitnami/apps/wordpress/htdocs/wp-content/uploads uploads_size: 3.26 GB (3497902207 bytes) themes_path: /opt/bitnami/apps/wordpress/htdocs/wp-content/themes themes_size: 24.04 MB (25205213 bytes) plugins_path: /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins plugins_size: 344.28 MB (361006032 bytes) database_size: 201.90 MB (211708576 bytes) total_size: 4.23 GB (4541874874 bytes)

wp-active-theme

name: OceanWP Child (oceanwp-child-theme-master) version: 1.0 author: Nick author_website: https://oceanwp.org/ parent_theme: OceanWP (oceanwp) theme_features: core-block-patterns, widgets-block-editor, align-wide, wp-block-styles, responsive-embeds, editor-styles, editor-style, menus, post-formats, title-tag, automatic-feed-links, post-thumbnails, custom-header, custom-logo, html5, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, customize-selective-refresh-widgets, widgets theme_path: /opt/bitnami/apps/wordpress/htdocs/wp-content/themes/oceanwp-child-theme-master auto_update: Disabled

wp-parent-theme

name: OceanWP (oceanwp) version: 3.1.0 author: Nick author_website: https://oceanwp.org/about-me/ theme_path: /opt/bitnami/apps/wordpress/htdocs/wp-content/themes/oceanwp auto_update: Disabled

wp-themes-inactive (1)

Twenty Twenty-One: version: 1.4, author: the WordPress team, Auto-updates disabled

wp-mu-plugins (1)

Elementor Safe Mode: version: 1.0.0, author: Elementor.com

wp-plugins-active (33)

Advanced Custom Fields PRO: version: 5.9.9, author: Delicious Brains (latest version: 5.11), Auto-updates disabled AnyWhere Elementor Pro: version: 2.20, author: WP Vibes, Auto-updates disabled Card Elements for Elementor: version: 1.1.4, author: Techeshta, Auto-updates disabled Classic Editor: version: 1.6.2, author: WordPress Contributors, Auto-updates disabled Code Snippets: version: 2.14.2, author: Code Snippets Pro, Auto-updates disabled Draw Attention: version: 1.9.26, author: N Squared, Auto-updates disabled Dynamic.ooo - Dynamic Content for Elementor: version: 1.16.4, author: Dynamic.ooo (latest version: 2.0.9), Auto-updates disabled Dynamic Visibility for Elementor: version: 4.1.0, author: Dynamic.ooo, Auto-updates disabled e-addons DISPLAY: version: 1.3.4, author: Nerds Farm, Auto-updates disabled e-addons for Elementor: version: 2.7.4, author: Nerds Farm (latest version: 2.7.6), Auto-updates disabled e-addons TEMPLATE: version: 1.2.1, author: Nerds Farm, Auto-updates disabled e-addons TWIG: version: 1.3.3, author: Nerds Farm, Auto-updates disabled Elementor: version: 3.4.3, author: Elementor.com (latest version: 3.4.7), Auto-updates disabled Elementor Addon Elements: version: 1.11.11, author: WPVibes, Auto-updates disabled Elementor Pro: version: 3.4.0, author: Elementor.com, Auto-updates disabled Essential Addons for Elementor: version: 4.9.6, author: WPDeveloper, Auto-updates disabled Essential Addons for Elementor - Pro: version: 4.4.10, author: WPDeveloper, Auto-updates disabled File Manager Advanced: version: 4.1, author: modalweb, Auto-updates disabled Ocean Extra: version: 1.9.0, author: OceanWP, Auto-updates disabled Pods - Custom Content Types and Fields: version: 2.8.3, author: Pods Framework Team, Auto-updates disabled Popup Trigger URL for Elementor Pro: version: 1.0.5, author: Suki WordPress Theme, Auto-updates disabled Posts Viewed Recently: version: 1.3.2, author: AS Tech Solutions, Auto-updates disabled Search & Filter Pro: version: 2.5.9, author: Code Amp, Auto-updates disabled Show IDs: version: 1.1.8, author: DraftPress, Auto-updates disabled Simple Custom CSS and JS PRO: version: 4.24, author: SilkyPress.com, Auto-updates disabled Stratum - Elementor Widgets: version: 1.3.11, author: MotoPress, Auto-updates disabled Unlimited Elements for Elementor (Premium): version: 1.4.77, author: Unlimited Elements, Auto-updates disabled UpdraftPlus - Backup/Restore: version: 1.16.63, author: UpdraftPlus.Com, DavidAnderson, Auto-updates disabled Wordfence Security: version: 7.5.6, author: Wordfence, Auto-updates disabled WP-Sweep: version: 1.1.5, author: Lester 'GaMerZ' Chan, Auto-updates disabled WP Fastest Cache: version: 0.9.5, author: Emre Vona, Auto-updates disabled WP Mail SMTP: version: 3.2.0, author: WPForms, Auto-updates disabled Yoast Duplicate Post: version: 4.1.2, author: Enrico Battocchi & Team Yoast, Auto-updates disabled

wp-plugins-inactive (31)

All-in-One WP Migration: version: 7.50, author: ServMask, Auto-updates disabled Author Image: version: 4.9.3, author: Denis de Bernardy & Mike Koepke, Auto-updates disabled Custom Content Shortcode: version: 3.8.7, author: Eliot Akira, Auto-updates disabled DD Last Viewed: version: 6.2.1, author: Wouter Dijkstra, Auto-updates disabled DynamicConditions: version: 1.5.1, author: RTO GmbH, Auto-updates disabled e-addons EDITOR: version: 1.9.5, author: Nerds Farm, Auto-updates disabled e-addons QUERY MEDIA: version: 1.4.3, author: Nerds Farm, Auto-updates disabled e-addons QUERY POSTS: version: 1.3.5, author: Nerds Farm, Auto-updates disabled ElementsKit Lite: version: 2.4.0, author: Wpmet, Auto-updates disabled ElementsKit Pro: version: 2.1.7, author: Wpmet, Auto-updates disabled Elfsight Google Maps CC: version: 2.4.2, author: Elfsight, Auto-updates disabled EmbedPress: version: 3.2.1, author: WPDeveloper, Auto-updates disabled Enable jQuery Migrate Helper: version: 1.3.0, author: The WordPress Team, Auto-updates disabled Feedzy RSS Feeds Lite: version: 3.8.0, author: Themeisle, Auto-updates disabled Feedzy RSS Feeds Premium: version: 1.7.1, author: Themeisle, Auto-updates disabled Gutenslider — The last WordPress slider you will ever need.: version: 5.4.6, author: eedee, Auto-updates disabled Insert PHP Code Snippet: version: 1.3.2, author: xyzscripts.com, Auto-updates disabled Lightbox - Gallery Lightbox: version: 2.0.4, author: wpdevart, Auto-updates disabled Ocean Social Sharing: version: 2.0.0, author: OceanWP, Auto-updates disabled Polylang: version: 3.1.2, author: WP SYNTEX, Auto-updates disabled Qi Addons For Elementor: version: 1.5.1, author: Qode Interactive, Auto-updates disabled QuadMenu: version: 2.1.9, author: Mega Menu, Auto-updates disabled QuadMenu - Astra Mega Menu: version: 1.1.5, author: QuadMenu, Auto-updates disabled Really Simple SSL: version: 5.1.3, author: Really Simple Plugins, Auto-updates disabled Shortcode in Menus: version: 3.5.1, author: Gagan Deep Singh, Auto-updates disabled Shortcodes Ultimate: version: 5.11.0, author: Vladimir Anokhin, Auto-updates disabled Unlimited Elements for Elementor: version: 1.4.88, author: Unlimited Elements, Auto-updates disabled WP Google Map Pro: version: 5.2.8, author: flippercode, Auto-updates disabled WP Google Maps: version: 8.1.18, author: WP Google Maps, Auto-updates disabled WP Recent Views: version: 1.0.1, author: jim912, Auto-updates disabled WP REST API Controller: version: 2.0.7, author: YIKES, Inc., Auto-updates disabled

wp-media

image_editor: WP_Image_Editor_Imagick imagick_module_version: 1688 imagemagick_version: ImageMagick 6.9.8-3 Q16 x86_64 2021-02-11 http://www.imagemagick.org imagick_version: 3.4.3 file_uploads: File uploads is turned off post_max_size: 40M upload_max_filesize: 40M max_effective_size: 40 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 8 GB imagick::RESOURCETYPE_DISK: -1 imagick::RESOURCETYPE_FILE: 768 imagick::RESOURCETYPE_MAP: 8 GB imagick::RESOURCETYPE_MEMORY: 4 GB imagick::RESOURCETYPE_THREAD: 1 imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, 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, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JNG, JNX, JPE, JPEG, JPG, JPS, 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, 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, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMF, WMV, WMZ, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, YCbCr, YCbCrA, YUV gd_version: bundled (2.1.0 compatible) gd_formats: GIF, JPEG, PNG, BMP ghostscript_version: 9.05

wp-server

server_architecture: Linux 4.19.0-17-cloud-amd64 x86_64 httpd_software: Apache php_version: 7.4.15 64bit php_sapi: fpm-fcgi max_input_variables: 1000 time_limit: 120 memory_limit: 512M max_input_time: 300 upload_max_filesize: 40M php_post_max_size: 40M curl_version: 7.75.0 OpenSSL/1.1.1i suhosin: false imagick_availability: true pretty_permalinks: true htaccess_extra_rules: false

wp-database

extension: mysqli server_version: 8.0.23 client_version: mysqlnd 7.4.15

wp-constants

WP_HOME: http://44.193.89.184/ WP_SITEURL: http://44.193.89.184/ WP_CONTENT_DIR: /opt/bitnami/apps/wordpress/htdocs/wp-content WP_PLUGIN_DIR: /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins WP_MEMORY_LIMIT: 256M WP_MAX_MEMORY_LIMIT: 512M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: true 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 mu-plugins: writable

wp_mail_smtp

version: 3.2.0 license_key_type: lite debug: No debug notices found. db_tables: wp_wpmailsmtp_tasks_meta, wp_wpmailsmtp_debug_events lite_install_date: Oct 18, 2021 @ 10:11am

pods

pods-server-software: Apache pods-user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36 pods-session-save-path: /opt/bitnami/php/tmp 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: No pods-object-cache-redis: No pods-memory-current-usage: 24.010M pods-memory-current-usage-real: 26.000M pods-network-wide: No pods-install-location: /opt/bitnami/apps/wordpress/htdocs/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

`

On Sat, Nov 13, 2021 at 11:44 PM Scott Kingsley Clark < @.***> wrote:

Can you provide a package of your configuration (Pods Admin > Migrate Packages) using the Migrate Packages component (Pods Admin > Components)? That might help us to see if we can reproduce the issue.

Also helpful would be access to your Site Health information (Tools > Site Health > Info Tab > Copy site info to clipboard) would also help us determine if there are any potential conflicts from other plugins or your theme.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pods-framework/pods/issues/6298#issuecomment-968205521, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALZBD4HQF5BHH3GKM4NEJVDUL45DBANCNFSM5HYHVB5A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

--

Thank you,

Best Regards,

Guillermo Guerra

JoryHogeveen commented 2 years ago

@sc0ttkclark I can confirm this issue

JoryHogeveen commented 2 years ago

I believe this commit broke it: https://github.com/pods-framework/pods/commit/23873b6f216ad758b0ceba3298e9fa27284c1b09 From then on, the pod param is empty.

JoryHogeveen commented 2 years ago

First fix I've found: https://github.com/pods-framework/pods/pull/6321/commits/2dd423acf081eaece1998e63e3c8f4c74e3169e6 This fixes the before tag.

The [after] tag is still not working, can't find what's wrong.

In frontier_end_template() the $code var contains the full template instead of only the [if] subtemplate.

JoryHogeveen commented 2 years ago

@sc0ttkclark Another user with the same issue: https://wordpress.org/support/topic/before-after-tag-stopped-working/

JoryHogeveen commented 2 years ago

Reported by another user: https://wordpress.org/support/topic/how-to-display-as-list-the-relation-feeld-with-simple-and-multi-select/

guille110187 commented 2 years ago

Fixed ???

sc0ttkclark commented 2 years ago

The short answer here is -- this wasn't an intentional feature for Pods Templates.

[each] was never supposed to support [before] and [after] within it.

I didn't write the initial code here but following all of the logic appears to show that to support [before] or [after] within an [each] would require a much bigger rewrite to juggle every since [before] / [after] cases within any [each] and outside of them.

Currently there can only be one [before] and one [after].

As of Pods 2.8.23, [before] and [after] are only working in the List template context.

The workaround for this would be to place an [if field_name] conditional tag around the [each field_name] and then put the actual content before/after the [each] tag itself.

I spent a great deal of time this morning trying to find some way to make this work within [each] context and it's just not going to work without a much bigger refactor.