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

Markdown option results in critical error #166

Closed adamjrice closed 7 months ago

adamjrice commented 7 months ago

Issue Overview

If the "Enable Markdown in HTML Fields" option in the pod-feed settings page is enabled, loading the GF form will result in a critical error. This is true even if there are no HTML fields actually configured.

I am including below a toy configuration that produces this behavior.

Expected Behavior

No errors.

Current Behavior

Loading a page containing the referenced GF form produces a critical error. In some conditions, I get a more verbose result:

Warning: Undefined variable $ajax in /Users/adamrice/Local Sites/burn-after-meeting/app/public/wp-content/plugins/pods-gravity-forms/includes/Pods_GF.php on line 4162

Fatal error: Array and string offset access syntax with curly braces is no longer supported in /Users/adamrice/Local Sites/burn-after-meeting/app/public/wp-content/plugins/pods-gravity-forms/includes/Markdown.php on line 1104

Possible Solution

???

Steps to Reproduce (for bugs)

  1. Create a Pods data type
  2. Create a GF form
  3. Create a feed to connect the data type and form; check the "Enable Markdown in HTML Fields" option
  4. Load a page containing the form or preview it from the GF admin page.

Form Upload

``` {"0":{"fields":[{"type":"text","id":1,"formId":1,"label":"Playa name","adminLabel":"","isRequired":false,"size":"large","errorMessage":"","visibility":"visible","inputs":null,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputMaskIsCustom":false,"maxLength":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","enableAutocomplete":false,"autocompleteAttribute":"","choices":"","conditionalLogic":"","productField":"","layoutGridColumnSpan":"","enablePasswordInput":"","enableEnhancedUI":0,"layoutGroupId":"1d981780","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"errors":[],"fields":""}],"button":{"type":"text","text":"","imageUrl":"","width":"auto","location":"bottom","layoutGridColumnSpan":12},"title":"profile","description":"","version":"2.8.5","id":1,"markupVersion":2,"nextFieldId":3,"useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"confirmations":[{"id":"65ee1fd0ec3ae","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"notifications":[{"id":"65ee1fd0ebe17","isActive":true,"to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"feeds":{"pods-gravity-forms":[{"id":"1","form_id":"1","is_active":"1","feed_order":"0","meta":{"feedName":"Pods Feed 1","pod":"user","custom_fields":[{"key":"","custom_key":"","value":"","custom_value":""}],"update_pod_item":"1","enable_markdown":"1","enable_current_user":"1","enable_prepopulate":"1","delete_entry":"0","feed_condition_conditional_logic_object":[],"feed_condition_conditional_logic":"0","pod_fields_event_year":"","pod_fields_playa_name":1,"wp_object_fields_user_login":"","wp_object_fields_user_nicename":"","wp_object_fields_display_name":"","wp_object_fields_user_pass":"","wp_object_fields_user_email":"","wp_object_fields_user_url":"","wp_object_fields_user_registered":"","feed_condition":""},"addon_slug":"pods-gravity-forms","event_type":null}]}},"version":"2.8.5"} ```

Pods Package Export

``` { "@meta": { "version": "3.1.4", "build": 1710105449 }, "settings": { "types_only": "0", "watch_changed_fields": "0", "metadata_integration": "1", "metadata_override_get": "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": "user", "id": 5, "label": "User", "description": "", "type": "user", "storage": "meta", "object": "user", "_migrated_28": "1", "groups": [ { "name": "more_fields", "id": 6, "label": "More Fields", "description": "", "weight": 0, "fields": [ { "name": "event_year", "id": 7, "label": "Event year", "description": "", "weight": 0, "type": "pick", "pick_object": "custom-simple", "sister_id": "-- Select One --", "pick_table": "-- Select One --", "required": "0", "pick_format_type": "multi", "pick_format_single": "dropdown", "pick_format_multi": "checkbox", "pick_display_format_multi": "default", "pick_display_format_separator": ", ", "pick_allow_add_new": "1", "pick_taggable": "0", "pick_show_icon": "1", "pick_show_edit_link": "1", "pick_show_view_link": "1", "pick_limit": "0", "pick_user_role": "Administrator", "pick_post_status": "publish", "pick_post_author": "0", "repeatable": "0", "repeatable_format": "default", "roles_allowed": "administrator", "enable_conditional_logic": "0", "rest_pick_response": "array", "rest_pick_depth": "1", "pick_custom": "2023\n2024\n2025" }, { "name": "playa_name", "id": 2103, "label": "Playa name", "description": "", "weight": 1, "type": "text", "sister_id": "-- Select One --", "required": "0", "text_allowed_html_tags": "strong em a ul ol li b i", "text_max_length": "255", "repeatable": "0", "repeatable_format": "default", "roles_allowed": "administrator", "enable_conditional_logic": "0", "rest_pick_response": "array", "rest_pick_depth": "1" } ] } ] } ] } ```

Related Issues and/or PRs

Todos

WordPress Environment

``` Copy and paste your System Details from **Pods Admin > Settings > Debug Information** in WordPress admin here. ```
sc0ttkclark commented 7 months ago

Fixed via https://github.com/pods-framework/pods-gravity-forms/commit/6774c56c67f35906eca976556250a18a263187ed