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

Compatibility issue between Pods and WPML - Divi theme #6295

Closed rcrdb closed 2 years ago

rcrdb commented 3 years ago

Description

Anytime we try to edit a translated custom post there is an issue stating: "There has been a critical error on this website. Please check your site admin email inbox for instructions." This is not happening only with original set language post which is english. This bug came out of nowhere. This was not happening few months ago.

Testing instructions

  1. Go to 'Tours' in the italian version
  2. Click on 'Edit'
  3. Scroll down to 'wait'
  4. See error message '....'

Expected behavior

I would be able to edit the post, add a featured image, post excerpt and more.

Screenshots / screencast

https://i.postimg.cc/Ss1gXP6Y/Screenshot-2021-11-08-182731.jpg

Possible workaround

cannot find a solution yet

Pods version

Version 2.8.3

Other super helpful information

Error Details

An error of type E_ERROR was caused in line 3523 of the file /nas/content/live/rileb/wp-content/plugins/pods/classes/PodsMeta.php. Error message: Uncaught Error: Call to a member function get_field() on bool in /nas/content/live/rileb/wp-content/plugins/pods/classes/PodsMeta.php:3523 Stack trace:

0 /nas/content/live/rileb/wp-content/plugins/pods/classes/PodsMeta.php(2722):

PodsMeta->get_meta('post_type', NULL, 366372, '_et_pb_use_buil...', true)

1 /nas/content/live/rileb/wp-includes/class-wp-hook.php(305):

PodsMeta->get_post_meta(NULL, 366372, '_et_pb_use_buil...', true)

2 /nas/content/live/rileb/wp-includes/plugin.php(189):

WP_Hook->apply_filters(NULL, Array)

3 /nas/content/live/rileb/wp-includes/meta.php(570):

apply_filters('get_post_metada...', NULL, 366372, '_et_pb_use_buil...', true, 'post')

4 /nas/content/live/rileb/wp-includes/meta.php(509):

get_metadata_raw('post', 366372, '_et_pb_use_buil...', true)

5 /nas/content/live/rileb/wp-includes/post.php(2303):

get_metadata('post', 366372, '_et_pb_use_buil...', true)

6 /nas/content/live/rileb/wp-content/themes/Divi/includes/builder/core.php(121):

get_post_meta(366372, '_et_pb_use_buil...', true)

WordPress Environment ``` ` ### wp-core ### version: 5.8.1 site_language: en_US user_language: en_US timezone: +00:00 permalink: /%postname%/ https_status: true multisite: false user_registration: 0 blog_public: 1 default_comment_status: open environment_type: production user_count: 22 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /nas/content/live/rileb wordpress_size: loading... uploads_path: /nas/content/live/rileb/wp-content/uploads uploads_size: loading... themes_path: /nas/content/live/rileb/wp-content/themes themes_size: loading... plugins_path: /nas/content/live/rileb/wp-content/plugins plugins_size: loading... database_size: loading... total_size: loading... ### wp-dropins (1) ### advanced-cache.php: true ### wp-active-theme ### name: Divi Child (divi-child) version: 1.0.0 author: Elegant Themes author_website: https://www.elegantthemes.com parent_theme: Divi (Divi) theme_features: core-block-patterns, widgets-block-editor, 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: /nas/content/live/rileb/wp-content/themes/divi-child auto_update: Disabled ### wp-parent-theme ### name: Divi (Divi) version: 4.13.0 author: Elegant Themes author_website: http://www.elegantthemes.com theme_path: /nas/content/live/rileb/wp-content/themes/Divi auto_update: Disabled ### wp-themes-inactive (11) ### Twenty Eleven: version: 3.9, author: the WordPress team, Auto-updates disabled Twenty Fifteen: version: 3.0, author: the WordPress team, Auto-updates disabled Twenty Fourteen: version: 3.2, author: the WordPress team, Auto-updates disabled Twenty Nineteen: version: 2.1, author: the WordPress team, Auto-updates disabled Twenty Seventeen: version: 2.8, author: the WordPress team, Auto-updates disabled Twenty Sixteen: version: 2.5, author: the WordPress team, Auto-updates disabled Twenty Ten: version: 3.5, author: the WordPress team, Auto-updates disabled Twenty Thirteen: version: 3.4, author: the WordPress team, Auto-updates disabled Twenty Twelve: version: 3.5, author: the WordPress team, Auto-updates disabled Twenty Twenty: version: 1.8, author: the WordPress team, Auto-updates disabled Twenty Twenty-One: version: 1.4, author: the WordPress team, Auto-updates disabled ### wp-mu-plugins (6) ### Force Strong Passwords - WPE Edition: version: 1.8.0, author: Jason Cosper WPE ElasticPress Autosuggest Logger: version: 1.0.0, author: WP Engine WP Engine Cache Plugin: version: 1.0.3, author: WP Engine WP Engine Seamless Login Plugin: version: 1.5.5, author: WP Engine WP Engine Security Auditor: version: 1.0.10, author: wpengine WP Engine System: version: 5.0.1, author: WP Engine ### wp-plugins-active (19) ### 301 Redirects: version: 2.70, author: WebFactory Ltd, Auto-updates disabled Asset CleanUp: Page Speed Booster: version: 1.3.8.4, author: Gabe Livan, Auto-updates disabled Caldera Forms: version: 1.9.5, author: Caldera Forms, Auto-updates disabled Divi FilterGrid: version: 2.7.7, author: DiviPlugins, Auto-updates disabled Divi Supreme Pro: version: 4.7.38, author: Divi Supreme, Auto-updates disabled EWWW Image Optimizer: version: 6.3.0, author: Exactly WWW, Auto-updates disabled La Sentinelle antispam: version: 2.0.3, author: Marcel Pol, Auto-updates disabled Pods - Custom Content Types and Fields: version: 2.8.3, author: Pods Framework Team, Auto-updates disabled Supreme Modules Lite - Divi Theme, Extra Theme and Divi Builder: version: 2.4.0, author: Supreme Modules, Auto-updates disabled The SEO Framework: version: 4.1.5.1, author: The SEO Framework Team, Auto-updates disabled WP-PageNavi: version: 2.94.0, author: Lester 'GaMerZ' Chan, Auto-updates disabled WP Cloudflare Super Page Cache: version: 4.5.7, author: Optimole, Auto-updates disabled WP Mail SMTP: version: 3.1.0, author: WPForms, Auto-updates disabled WPML Media: version: 2.6.5, author: OnTheGoSystems, Auto-updates disabled WPML Multilingual CMS: version: 4.4.12, author: OnTheGoSystems, Auto-updates disabled WPML SEO: version: 2.0.1, author: OnTheGoSystems, Auto-updates disabled WPML String Translation: version: 3.1.10, author: OnTheGoSystems, Auto-updates disabled WPML Translation Management: version: 2.10.8, author: OnTheGoSystems, Auto-updates disabled WP Stripe Checkout: version: 1.2.2, author: naa986, Auto-updates disabled ### wp-plugins-inactive (3) ### Advanced Database Cleaner PRO: version: 3.1.6, author: Younes JFR., Auto-updates disabled PrivateContent: version: 7.321, author: Luca Montanari, Auto-updates disabled Yoast Duplicate Post: version: 4.1.2, author: Enrico Battocchi & Team Yoast, Auto-updates disabled ### wp-media ### image_editor: EWWWIO_Imagick_Editor imagick_module_version: 1687 imagemagick_version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org imagick_version: 3.4.4 file_uploads: File uploads is turned off post_max_size: 200M upload_max_filesize: 200M max_effective_size: 200 MB max_file_uploads: 20 gd_version: 2.2.5 gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: unknown ### wp-server ### server_architecture: Linux 5.4.0-1053-gcp x86_64 httpd_software: Apache php_version: 7.4.24 64bit php_sapi: apache2handler max_input_variables: 10000 time_limit: 3600 memory_limit: 512M max_input_time: 3600 upload_max_filesize: 200M php_post_max_size: 200M curl_version: 7.58.0 OpenSSL/1.1.1 suhosin: false imagick_availability: true pretty_permalinks: true htaccess_extra_rules: true ### wp-database ### extension: mysqli server_version: 5.7.35-38-log client_version: mysqlnd 7.4.24 ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /nas/content/live/rileb/wp-content WP_PLUGIN_DIR: /nas/content/live/rileb/wp-content/plugins WP_MEMORY_LIMIT: 512M WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: true CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_LOCAL_DEV: undefined DB_CHARSET: utf8 DB_COLLATE: utf8_unicode_ci ### wp-filesystem ### wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable mu-plugins: writable ### wp_mail_smtp ### version: 3.1.0 license_key_type: lite debug: No debug notices found. db_tables: wp_wpmailsmtp_tasks_meta, wp_wpmailsmtp_debug_events lite_install_date: Apr 16, 2021 @ 4:52pm ### pods ### pods-server-software: Apache pods-user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 pods-session-save-path: /var/lib/php/sessions 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: Yes pods-object-cache-redis: Yes pods-memory-current-usage: 20.044M pods-memory-current-usage-real: 14.000M pods-network-wide: No pods-install-location: /nas/content/live/rileb/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 ` ```

I only exported the custom post type which is having the issue.

Pods Package Export ```json { "meta": { "version": "2.8.3", "build": 1636397952 }, "pods": [ { "name": "tour", "id": 358286, "label": "Tours", "description": "", "type": "post_type", "storage": "meta", "show_in_menu": "1", "label_singular": "Tour", "public": "1", "show_ui": "1", "supports_title": "1", "supports_editor": "1", "publicly_queryable": "1", "exclude_from_search": "0", "capability_type": "post", "capability_type_custom": "tour", "capability_type_extra": "1", "has_archive": "0", "hierarchical": "0", "rewrite": "1", "rewrite_custom_slug": "tours", "rewrite_with_front": "1", "rewrite_feeds": "0", "rewrite_pages": "1", "query_var": "1", "can_export": "1", "default_status": "draft", "supports_author": "1", "supports_thumbnail": "1", "supports_excerpt": "1", "supports_trackbacks": "1", "supports_custom_fields": "1", "supports_comments": "1", "supports_revisions": "1", "supports_page_attributes": "1", "supports_post_formats": "1", "built_in_taxonomies_category": "0", "built_in_taxonomies_link_category": "0", "built_in_taxonomies_post_tag": "0", "built_in_taxonomies_project_category": "0", "built_in_taxonomies_project_tag": "0", "menu_position": "5", "show_in_nav_menus": "1", "show_in_admin_bar": "1", "pfat_enable": "0", "pfat_run_outside_loop": "0", "pfat_append_single": "append", "pfat_filter_single": "the_content", "pfat_append_archive": "append", "pfat_filter_archive": "custom", "rest_enable": "0", "read_all": "0", "write_all": "0", "built_in_taxonomies_activity": "1", "pfat_filter_archive_custom": "the_content", "_wpml_media_featured": "0", "_wpml_media_duplicate": "0", "built_in_taxonomies_tour_tag": "1", "built_in_taxonomies_type": "1", "built_in_taxonomies_duration": "1", "_migrated_28": "1", "_wpml_location_migration_done": "1", "groups": [ { "name": "more_fields", "id": 366376, "label": "More Fields", "description": "", "weight": 0, "fields": [] } ] } ] } ```
sc0ttkclark commented 3 years ago

@JoryHogeveen Can you take a look at the issue here this week and let me know what you find out?

sc0ttkclark commented 3 years ago

I'm not sure what caused this issue specifically but I can say that it's resolved in 2.8.4 by additional checks to see whether a Pod object exists before this line.

JoryHogeveen commented 2 years ago

Same issue as #6301 which I also cannot reproduce :/

JoryHogeveen commented 2 years ago

Tested again and still am not able to reproduce. What I believe is happening is that it tries to auto-translate the ID into a post that cannot be found for some reason. https://github.com/pods-framework/pods/blob/2.8.3/classes/PodsMeta.php#L3492-L3496

However, I cannot reproduce this behavior, not can I find why it would do so..

sc0ttkclark commented 2 years ago

Closing as assumed fixed since there hasn't been an update from the original reporter and they were running Pods 2.8.3 (fix in Pods 2.8.4 went out to resolve this specific issue).