pods-framework / pods-gravity-forms

Integration with Gravity Forms plugin for WordPress (https://pods.io/gravityforms/)
https://wordpress.org/plugins/pods-gravity-forms/
GNU General Public License v2.0
62 stars 10 forks source link

Fatal Error using PHP8 #163

Closed LaurieY closed 5 months ago

LaurieY commented 1 year ago

Issue Overview

Error Using PHP 8 PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /var/www/devroot/wp/wp-content/plugins/pods-gravity-forms/includes/Markdown.php on line 1104 when previewing or using a form

Expected Behavior

Should display the form

Current Behavior

Undefined variable $ajax in /var/www/devroot/wp/wp-content/plugins/pods-gravity-forms/includes/Pods_GF.php on line 4162

Possible Solution

Need to change the uses of {n} to [n] in includes/Pods_GF.php

Steps to Reproduce (for bugs)

preview any form that includes a pods feed

Form Upload

``` {"0":{"title":"Lecture Entry Form","description":"Allows the entry of a new lecture.","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"text","id":1,"label":"Lecture Title","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":2,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputMaskIsCustom":false,"maxLength":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","enablePasswordInput":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"fields":"","displayOnly":""},{"type":"date","id":2,"label":"Lecture Date","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"dateType":"datepicker","calendarIconType":"calendar","formId":2,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputMaskIsCustom":false,"maxLength":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","calendarIconUrl":"","dateFormat":"dmy_dash","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"fields":"","displayOnly":""},{"type":"time","id":3,"label":"Lecture Time","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":[{"id":"3.1","label":"HH","name":""},{"id":"3.2","label":"MM","name":""},{"id":"3.3","label":"AM\/PM","name":""}],"formId":2,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputMaskIsCustom":false,"maxLength":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","timeFormat":"12","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"fields":"","displayOnly":""},{"type":"text","id":4,"label":"Speaker","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":2,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputMaskIsCustom":false,"maxLength":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","enablePasswordInput":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"fields":"","displayOnly":""},{"type":"text","id":5,"label":"Organisation","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":2,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputMaskIsCustom":false,"maxLength":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","enablePasswordInput":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"fields":"","displayOnly":""},{"type":"text","id":6,"label":"Location","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":2,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputMaskIsCustom":false,"maxLength":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","enablePasswordInput":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"fields":"","displayOnly":""}],"version":"2.4.20","id":2,"nextFieldId":7,"useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"notifications":[{"id":"611ae34e46665","isActive":true,"to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"confirmations":[{"id":"611ae34e468c1","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"subLabelPlacement":"below","cssClass":"","enableHoneypot":false,"enableAnimation":false,"save":{"enabled":false,"button":{"type":"link","text":"Save and Continue Later"}},"limitEntries":false,"limitEntriesCount":"","limitEntriesPeriod":"","limitEntriesMessage":"","scheduleForm":false,"scheduleStart":"","scheduleStartHour":"","scheduleStartMinute":"","scheduleStartAmpm":"","scheduleEnd":"","scheduleEndHour":"","scheduleEndMinute":"","scheduleEndAmpm":"","schedulePendingMessage":"","scheduleMessage":"","requireLogin":false,"requireLoginMessage":"","feeds":{"pods-gravity-forms":[{"id":"2","form_id":"2","is_active":"1","feed_order":"0","meta":{"feedName":"Pods Feed 2","pod":"lecture","pod_fields_lecture_title":"1","pod_fields_lecture_title_custom":"1","pod_fields_lecture_date":"2","pod_fields_lecture_date_custom":"2","pod_fields_lecture_time":"3","pod_fields_lecture_time_custom":"3","pod_fields_speaker":"4","pod_fields_speaker_custom":"4","pod_fields_organisation":"5","pod_fields_organisation_custom":"5","pod_fields_location":"6","pod_fields_location_custom":"6","wp_object_fields_post_title":"1","wp_object_fields_post_title_custom":"","wp_object_fields_post_content":"","wp_object_fields_post_content_custom":"","wp_object_fields_post_excerpt":"","wp_object_fields_post_excerpt_custom":"","wp_object_fields_post_author":"","wp_object_fields_post_author_custom":"","wp_object_fields_post_date":"","wp_object_fields_post_date_custom":"","wp_object_fields_post_name":"","wp_object_fields_post_name_custom":"","wp_object_fields_post_modified":"","wp_object_fields_post_modified_custom":"","wp_object_fields_post_parent":"","wp_object_fields_post_parent_custom":"","wp_object_fields_comments":"","wp_object_fields_comments_custom":"","wp_object_fields__thumbnail_id":"","wp_object_fields__thumbnail_id_custom":"","custom_fields":"","update_pod_item":"1","enable_markdown":"1","enable_current_post":"1","enable_prepopulate":"1","delete_entry":"0","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[]},"addon_slug":"pods-gravity-forms","event_type":null}]}},"version":"2.7.3"} ```

Pods Package Export

``` { "@meta": { "version": "2.9.13", "build": 1679907421 }, "settings": { "types_only": "0", "watch_changed_fields": "1", "metadata_integration": "1", "metadata_override_get": "1", "session_auto_start": "0", "wisdom_opt_out": "1" }, "pods": [ { "name": "lecture", "id": 188, "label": "Lectures", "description": "", "label_singular": "Lecture", "public": "1", "show_ui": "1", "supports_title": "1", "supports_editor": "1", "type": "post_type", "storage": "meta", "publicly_queryable": "1", "exclude_from_search": "0", "capability_type": "post", "capability_type_custom": "lecture", "capability_type_extra": "1", "has_archive": "0", "hierarchical": "0", "rewrite": "1", "rewrite_with_front": "1", "rewrite_feeds": "0", "rewrite_pages": "1", "query_var": "1", "can_export": "1", "default_status": "draft", "supports_author": "0", "supports_thumbnail": "0", "supports_excerpt": "0", "supports_trackbacks": "0", "supports_custom_fields": "0", "supports_comments": "0", "supports_revisions": "0", "supports_page_attributes": "0", "supports_post_formats": "0", "built_in_taxonomies_category": "0", "built_in_taxonomies_link_category": "0", "built_in_taxonomies_post_tag": "0", "show_in_menu": "1", "menu_position": "0", "show_in_nav_menus": "1", "show_in_admin_bar": "1", "pfat_enable": "1", "pfat_append_single": "replace", "pfat_filter_single": "the_content", "pfat_append_archive": "append", "pfat_filter_archive": "the_excerpt", "pfat_run_outside_loop": "0", "rest_enable": "1", "read_all": "1", "write_all": "1", "pfat_single": "Lecture Template", "menu_icon": "dashicons-tickets-alt", "built_in_taxonomies_wp_theme": "0", "_migrated_28": "1", "groups": [ { "name": "more_fields", "id": 2550, "label": "More Fields", "description": "", "weight": 0, "fields": [ { "name": "lecture_title", "id": 189, "label": "Lecture Title", "description": "", "weight": 0, "type": "text", "required": "1", "text_allow_shortcode": "0", "text_allow_html": "0", "text_allowed_html_tags": "strong em a ul ol li b i", "text_max_length": "255", "admin_only": "0", "restrict_role": "0", "restrict_capability": "0", "hidden": "0", "read_only": "0", "roles_allowed": [ "administrator" ], "rest_read": "0", "rest_write": "0", "rest_pick_response": "array", "rest_pick_depth": "1", "unique": "0", "text_repeatable": "0" }, { "name": "lecture_date", "id": 190, "label": "Lecture Date", "description": "", "weight": 1, "type": "date", "required": "1", "date_type": "custom", "date_format": "dMy_dash", "date_allow_empty": "1", "date_html5": "0", "admin_only": "0", "restrict_role": "0", "restrict_capability": "0", "hidden": "0", "read_only": "0", "roles_allowed": [ "administrator" ], "rest_read": "0", "rest_write": "0", "rest_pick_response": "array", "rest_pick_depth": "1", "unique": "0", "date_repeatable": "0", "date_format_custom": "d M Y" }, { "name": "lecture_time", "id": 192, "label": "Lecture Time", "description": "", "weight": 2, "type": "time", "required": "1", "time_type": "wp", "time_format": "h_mm_A", "time_format_24": "hh_mm", "time_allow_empty": "1", "time_html5": "0", "admin_only": "0", "restrict_role": "0", "restrict_capability": "0", "hidden": "0", "read_only": "0", "roles_allowed": [ "administrator" ], "rest_read": "0", "rest_write": "0", "rest_pick_response": "array", "rest_pick_depth": "1", "unique": "0", "time_repeatable": "0" }, { "name": "speaker", "id": 191, "label": "Speaker", "description": "", "weight": 3, "type": "text", "required": "0", "text_allow_shortcode": "0", "text_allow_html": "0", "text_allowed_html_tags": "strong em a ul ol li b i", "text_max_length": "255", "admin_only": "0", "restrict_role": "0", "restrict_capability": "0", "hidden": "0", "read_only": "0", "roles_allowed": [ "administrator" ], "rest_read": "0", "rest_write": "0", "rest_pick_response": "array", "rest_pick_depth": "1", "unique": "0", "text_repeatable": "0" }, { "name": "organisation", "id": 193, "label": "Organisation", "description": "", "weight": 4, "type": "text", "required": "0", "text_allow_shortcode": "0", "text_allow_html": "0", "text_allowed_html_tags": "strong em a ul ol li b i", "text_max_length": "255", "admin_only": "0", "restrict_role": "0", "restrict_capability": "0", "hidden": "0", "read_only": "0", "roles_allowed": [ "administrator" ], "rest_read": "0", "rest_write": "0", "rest_pick_response": "array", "rest_pick_depth": "1", "unique": "0", "text_repeatable": "0" }, { "name": "location", "id": 194, "label": "Location", "description": "", "weight": 5, "type": "text", "required": "1", "text_allow_shortcode": "0", "text_allow_html": "0", "text_allowed_html_tags": "strong em a ul ol li b i", "text_max_length": "255", "admin_only": "0", "restrict_role": "0", "restrict_capability": "0", "hidden": "0", "read_only": "0", "roles_allowed": [ "administrator" ], "rest_read": "0", "rest_write": "0", "rest_pick_response": "array", "rest_pick_depth": "1", "unique": "0", "text_repeatable": "0" }, { "name": "additional_info", "id": 3138, "label": "Additional Info", "description": "Can be supplement to the topic, it's sync'd from the notes field", "weight": 6, "type": "wysiwyg", "sister_id": "-- Select One --", "required": "0", "wysiwyg_editor": "tinymce", "roles_allowed": "administrator", "rest_pick_response": "array", "rest_pick_depth": "1", "wysiwyg_media_buttons": "1", "rest_read": "1", "rest_write": "1" } ] } ] } ] } ```

Related Issues and/or PRs

Todos

WordPress Environment

``` ` ### wp-core ### version: 6.1.1 site_language: en_GB user_language: en_GB timezone: Europe/London permalink: /%year%/%monthnum%/%day%/%postname%/ https_status: true multisite: false user_registration: 0 blog_public: 0 default_comment_status: undefined environment_type: production user_count: 102 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /home/maccastr/wpdev wordpress_size: 381.53 MB (400062136 bytes) uploads_path: /home/maccastr/testrecordingssaved/recordings uploads_size: 778.54 MB (816354209 bytes) themes_path: /home/maccastr/wpdev/wp-content/themes themes_size: 21.07 MB (22091534 bytes) plugins_path: /home/maccastr/wpdev/wp-content/plugins plugins_size: 117.60 MB (123310845 bytes) database_size: 12.74 MB (13355109 bytes) total_size: 1.28 GB (1375173833 bytes) ### wp-active-theme ### name: Astra Child (astra-child) version: 1.0.0 author: Laurie Yates author_website: https://maccastrosoc.com parent_theme: Astra (astra) theme_features: core-block-patterns, astra_hooks, widgets-block-editor, align-wide, automatic-feed-links, title-tag, post-thumbnails, starter-content, html5, post-formats, custom-logo, customize-selective-refresh-widgets, editor-style, woocommerce, rank-math-breadcrumbs, amp, editor-color-palette, widgets, menus theme_path: /home/maccastr/wpdev/wp-content/themes/astra-child auto_update: Disabled ### wp-parent-theme ### name: Astra (astra) version: 4.0.2 author: Brainstorm Force author_website: https://wpastra.com/about/?utm_source=theme_preview&utm_medium=author_link&utm_campaign=astra_theme theme_path: /home/maccastr/wpdev/wp-content/themes/astra auto_update: Disabled ### wp-themes-inactive (3) ### Dark Mode for A.: version: 1.1, author: Bryan Hadaway, Auto-updates disabled Twenty Twenty-Three: version: 1.0, author: the WordPress team, Auto-updates disabled Twenty Twenty-Two: version: 1.3, author: the WordPress team, Auto-updates disabled ### wp-mu-plugins (1) ### Health Check Troubleshooting Mode: author: (undefined), version: 1.8.1 ### wp-plugins-active (23) ### Big File Uploads: version: 2.1.1, author: Infinite Uploads, Auto-updates disabled Code Snippets: version: 3.3.0, author: Code Snippets Pro, Auto-updates disabled CookieYes | GDPR Cookie Consent: version: 3.0.8, author: CookieYes, Auto-updates disabled Duplicator: version: 1.5.3.1, author: Snap Creek, Auto-updates disabled Google Analytics for WordPress by MonsterInsights: version: 8.13.1, author: MonsterInsights, Auto-updates disabled Gravity Forms: version: 2.7.3, author: Gravity Forms, Auto-updates enabled Health Check & Troubleshooting: version: 1.5.1, author: The WordPress.org community, Auto-updates disabled Macc-Pods: version: 1.00.00, author: Laurie Yates, Auto-updates disabled Maccastro Sync plugin Live: version: 1.0, author: Laurie Yates, Auto-updates disabled MetaSlider: version: 3.29.1, author: MetaSlider, Auto-updates disabled Modula: version: 2.7.3, author: WPChill, Auto-updates disabled Pods - Custom Content Types and Fields: version: 2.9.13, author: Pods Framework Team, Auto-updates disabled Pods Gravity Forms Add-On: version: 1.4.5, author: Pods Framework Team, Auto-updates disabled PublishPress Capabilities: version: 2.7.0, author: PublishPress, Auto-updates disabled Simple History: version: 3.4.0, author: Pär Thernström, Auto-updates disabled Simple Local Avatars: version: 2.7.4, author: 10up, Auto-updates disabled Theme My Login: version: 7.1.5, author: Theme My Login, Auto-updates disabled UpdraftPlus - Backup/Restore: version: 1.23.3, author: UpdraftPlus.Com, DavidAnderson, Auto-updates disabled User Access Manager: version: 2.2.20, author: Alexander Schneider, Auto-updates disabled View Admin As: version: 1.8.8, author: Jory Hogeveen, Auto-updates disabled What The File: version: 1.6.0, author: Never5, Auto-updates disabled WPFront Scroll Top: version: 2.0.7.08086, author: Syam Mohan, Auto-updates disabled WP Rollback: version: 1.7.3, author: GiveWP.com, Auto-updates disabled ### wp-plugins-inactive (13) ### Akismet Anti-Spam: version: 5.1, author: Automattic, Auto-updates disabled Contact Form 7: version: 5.7.5.1, author: Takayuki Miyoshi, Auto-updates enabled Custom Twitter Feeds: version: 2.0.6, author: Smash Balloon, Auto-updates enabled Duplicate Page: version: 4.5.1, author: mndpsingh287, Auto-updates disabled Import Export WordPress Users and WooCommerce Customers: version: 2.3.8, author: WebToffee, Auto-updates disabled Import Users from CSV: version: 1.1, author: Andrew Lima, Auto-updates disabled JSON Basic Authentication: version: 0.1, author: WordPress API Team, Auto-updates disabled LiteSpeed Cache: version: 5.3.3, author: LiteSpeed Technologies, Auto-updates disabled Paid Memberships Pro: version: 2.10.3, author: Paid Memberships Pro, Auto-updates disabled PostX - Gutenberg Post Grid Blocks: version: 2.8.9, author: wpxpo, Auto-updates disabled V1_macc-pods: version: 1.00.00, author: Laurie Yates, Auto-updates disabled Wordpress File Upload: version: 4.18.1, author: Nickolas Bossinas, Auto-updates disabled WP Content Copy Protection & No Right Click: version: 3.5.2, author: wp-buy, Auto-updates disabled ### wp-media ### image_editor: WP_Image_Editor_GD imagick_module_version: Not available imagemagick_version: Not available imagick_version: Not available file_uploads: File uploads is turned off post_max_size: 64M upload_max_filesize: 64M max_effective_size: 64 MB max_file_uploads: 20 gd_version: bundled (2.1.0 compatible) gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: 9.25 ### wp-server ### server_architecture: Linux 3.10.0-962.3.2.lve1.5.70.el7.x86_64 x86_64 httpd_software: LiteSpeed php_version: 8.1.16 64bit php_sapi: litespeed max_input_variables: 1000 time_limit: 30 memory_limit: 256M max_input_time: 60 upload_max_filesize: 64M php_post_max_size: 64M curl_version: 7.88.0 OpenSSL/1.1.1t suhosin: false imagick_availability: false pretty_permalinks: true htaccess_extra_rules: true ### wp-database ### extension: mysqli server_version: 10.3.38-MariaDB-log-cll-lve client_version: mysqlnd 8.1.16 max_allowed_packet: 268435456 max_connections: 500 ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /home/maccastr/wpdev/wp-content WP_PLUGIN_DIR: /home/maccastr/wpdev/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: Undefined 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: LiteSpeed pods-user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 pods-session-save-path: /var/cpanel/php/sessions/ea-php81 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: 99.974M pods-memory-current-usage-real: 101.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: 241 ### modula ### core_version: Core version 2.7.3 requested_php: PHP minimum version met requested_wp: Wordpress minimum version met. Current version: 6.1.1 galleries_number: Total number of galleries: 1 track_data: Track data enabled enqueue_files: Enqueue files disabled grid_type: No grid type selected lightboxes: No lightbox selected modula_lazyload: No general lazyload modula_edit_gallery_link: Edit gallery link enabled modula_disable_srcset: srcset is enabled ` ```
sc0ttkclark commented 5 months ago

Fixed in Pods GF 1.5