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 processing shortcode [each category] with posts #5971

Closed visualthinkin closed 3 years ago

visualthinkin commented 3 years ago

Description

Hi, I am working on a page to display my regular posts on a grid showing image, title, link and categories with links. On the Wordpress page I call the template with this code:

[pods name="post" template="post_loop" orderby="post_date DESC" pagination=true limit=12 pagination_location="after" offset=3 pagination_type="simple"]

My "post_loop" template contains this code, that causes the bug: [each category] <a href="{@category.permalink}">{@category}</a> [/each]

I get the following php notice: Notice: Trying to get property 'api' of non-object in ...wp-content/plugins/pods/components/Templates/includes/functions-view_template.php on line 301

And a "Pod not found" message on the page instead of the categories list.

Expected behavior

Should return all the categories associated to the posts. As the plugin does with custom taxonomies.

Screenshots / screencast

Captura de pantalla 2021-03-15 a las 0 21 37

Possible workaround

If i use this without the [each] shortcode <a href="{@category.permalink}">{@category}</a>

I get all the categories on a group. So it only works for posts with a single category.

Pods version

Version 2.7.26

Other super helpful information

WordPress Environment ``` ` ### wp-core ### version: 5.6.2 site_language: en_US user_language: en_US timezone: Europe/Madrid permalink: /%postname%/ https_status: true multisite: false user_registration: 0 blog_public: 0 default_comment_status: closed environment_type: production user_count: 6 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /home/visualt1/public_html/madridev wordpress_size: 142.35 MB (149263032 bytes) uploads_path: /home/visualt1/public_html/madridev/wp-content/uploads uploads_size: 3.32 GB (3562537768 bytes) themes_path: /home/visualt1/public_html/madridev/wp-content/themes themes_size: 53.99 MB (56610999 bytes) plugins_path: /home/visualt1/public_html/madridev/wp-content/plugins plugins_size: 218.45 MB (229066659 bytes) database_size: 63.73 MB (66821644 bytes) total_size: 3.79 GB (4064300102 bytes) ### wp-dropins (1) ### maintenance.php: true ### wp-active-theme ### name: Club de Madrid hijo (ClubdeMadrid-hijo) version: 4.5.1.1597927454 author: Elegant Themes author_website: http://www.elegantthemes.com parent_theme: Divi (Divi) theme_features: core-block-patterns, custom-background, automatic-feed-links, post-thumbnails, menus, title-tag, post-formats, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, customize-selective-refresh-widgets, editor-style, widgets theme_path: /home/visualt1/public_html/madridev/wp-content/themes/ClubdeMadrid-hijo auto_update: Disabled ### wp-parent-theme ### name: Divi (Divi) version: 4.8.2 (latest version: 4.9.2) author: Elegant Themes author_website: http://www.elegantthemes.com theme_path: /home/visualt1/public_html/madridev/wp-content/themes/Divi auto_update: Disabled ### wp-themes-inactive (2) ### Club de Madrid: version: 1.0, author: Estado Digital, Auto-updates disabled Twenty Nineteen: version: 1.9, author: the WordPress team (latest version: 2.0), Auto-updates disabled ### wp-plugins-active (5) ### FacetWP: version: 3.2.5, author: FacetWP, LLC (latest version: 3.7.4), Auto-updates disabled FacetWP - Pods integration: version: 1.0, author: FacetWP, LLC, Auto-updates disabled Pods - Custom Content Types and Fields: version: 2.7.26, author: Pods Framework Team, Auto-updates disabled Redirection: version: 5.0.1, author: John Godley, Auto-updates disabled Regenerate Thumbnails: version: 3.1.4, author: Alex Mills (Viper007Bond) (latest version: 3.1.5), Auto-updates disabled ### wp-plugins-inactive (27) ### Advanced Editor Tools (previously TinyMCE Advanced): version: 5.6.0, author: Automattic, Auto-updates disabled Advanced Rich Text Tools for Gutenberg: version: 1.2.0, author: Ella Van Durpe, Auto-updates disabled Category Order and Taxonomy Terms Order: version: 1.5.7.4, author: Nsp-Code, Auto-updates disabled Constant Contact Forms for WordPress: version: 1.10.1, author: Constant Contact, Auto-updates disabled Divi Builder: version: 4.8.2, author: Elegant Themes (latest version: 4.9.2), Auto-updates disabled Duplicator: version: 1.3.40.1, author: Snap Creek (latest version: 1.4.0), Auto-updates disabled Easy Pull Quotes: version: 1.2.2, author: Jason Yingling, Auto-updates disabled Enable Media Replace: version: 3.5.0, author: ShortPixel, Auto-updates disabled Google Tag Manager: version: 1.0.5, author: Justin Rains, Auto-updates disabled Google Tag Manager for Wordpress: version: 1.11.6, author: Thomas Geiger, Auto-updates disabled Health Check & Troubleshooting: version: 1.4.5, author: The WordPress.org community, Auto-updates disabled Infogr.am: author: (undefined), version: 1.6.1, Auto-updates disabled iThemes Security: version: 7.9.0, author: iThemes, Auto-updates disabled NextGEN Gallery: version: 3.6.0, author: Imagely (latest version: 3.8.0), Auto-updates disabled Perfect Pullquotes: version: 1.7.5, author: Adam DeHaven, Auto-updates disabled Permalink Manager Lite: version: 2.2.9.6, author: Maciej Bis (latest version: 2.2.9.7), Auto-updates disabled Photo Gallery: version: 1.5.68, author: Photo Gallery Team (latest version: 1.5.69), Auto-updates disabled Photonic Gallery & Lightbox for Flickr, SmugMug, Google Photos & Others: version: 2.69, author: Sayontan Sinha (latest version: 2.72), Auto-updates disabled Post Types Order: version: 1.9.5.4, author: Nsp Code (latest version: 1.9.5.5), Auto-updates disabled Simple Share Buttons Adder: version: 8.1.2, author: Simple Share Buttons, Auto-updates disabled Smash Balloon Instagram Feed: version: 2.7, author: Smash Balloon (latest version: 2.8.2), Auto-updates disabled Tripetto: version: 3.2.0, author: Tripetto (latest version: 3.3.1), Auto-updates disabled UI for Pods Framework: version: 0.3.0, author: Andrés Ullúa, Auto-updates disabled W3 Total Cache: version: 2.1.0, author: BoldGrid (latest version: 2.1.1), Auto-updates disabled WordPress Importer: version: 0.7, author: wordpressdotorg, Auto-updates disabled WPForms: version: 1.5.2.3, author: WPForms, Auto-updates disabled Yoast SEO: version: 15.8, author: Team Yoast (latest version: 15.9.2), Auto-updates disabled ### wp-media ### image_editor: WP_Image_Editor_Imagick imagick_module_version: 1802 imagemagick_version: ImageMagick 7.0.10-10 Q16 x86_64 2020-07-09 https://imagemagick.org file_uploads: File uploads is turned off post_max_size: 64M upload_max_filesize: 64M max_effective_size: 64 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 251 GB imagick::RESOURCETYPE_DISK: 9.2233720368548E+18 imagick::RESOURCETYPE_FILE: 37500 imagick::RESOURCETYPE_MAP: 251 GB imagick::RESOURCETYPE_MEMORY: 126 GB imagick::RESOURCETYPE_THREAD: 1 gd_version: 2.2.5 ghostscript_version: 9.25 ### wp-server ### server_architecture: Linux 3.10.0-962.3.2.lve1.5.42.el7.x86_64 x86_64 httpd_software: LiteSpeed php_version: 7.4.15 64bit php_sapi: litespeed max_input_variables: 4000 time_limit: 180 memory_limit: 256M max_input_time: 120 upload_max_filesize: 64M php_post_max_size: 64M curl_version: 7.71.0 OpenSSL/1.1.1d suhosin: false imagick_availability: true pretty_permalinks: true htaccess_extra_rules: false ### wp-database ### extension: mysqli server_version: 10.3.28-MariaDB client_version: mysqlnd 7.4.15 ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /home/visualt1/public_html/madridev/wp-content WP_PLUGIN_DIR: /home/visualt1/public_html/madridev/wp-content/plugins 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_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: LiteSpeed pods-user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36 pods-session-save-path: /opt/alt/php74/var/lib/php/session 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: No 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: 50.391M pods-memory-current-usage-real: 52.500M pods-network-wide: No pods-install-location: /home/visualt1/public_html/madridev/wp-content/plugins/pods/ pods-developer: No pods-tableless-mode: No pods-light-mode: No pods-strict: Yes pods-allow-deprecated: No pods-api-cache: Yes pods-shortcode-allow-evaluate-tags: No ````
Pods Package Export ```json Copy and paste your Pods Admin > Migrate: Packages > Export and paste the code over this line. ```
sc0ttkclark commented 3 years ago

Let's retest this with Pods 2.8

sc0ttkclark commented 3 years ago

Additional fixes done as part of f09a3fb1e2f08cfb0ce90b156e8eb32bd14da001