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

Mulitple posts created when Enable populating field values for this form using current post is true #106

Closed kendellDaniel closed 6 years ago

kendellDaniel commented 6 years ago

Issue Overview

Separate post get's created on form submission

Expected Behavior

If "Enable editing with this form using current post" and "Enable populating field values for this form using current post" is enabled, on form submission the same post should be edited and not create a new post with the new content.

Current Behavior

When a form submits with "Enable editing with this form using current post" and "Enable populating field values for this form using current post" a new post is created.

Possible Solution

Once "Enable editing with this form using current post" and "Enable populating field values for this form using current post" is enabled then post should be updated and not create a new post.

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Form Upload

``` {"0":{"title":"Clever ED Notes","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"username","id":1,"label":"Username","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","inputs":null,"formId":10,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","visibility":"hidden","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","enablePasswordInput":"","maxLength":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":""},{"type":"text","id":2,"label":"Lesson\/Topic","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","inputs":null,"formId":10,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"Course_Notes_Title","visibility":"visible","noDuplicates":false,"defaultValue":"{embed_post:post_title}","choices":"","conditionalLogic":"","productField":"","enablePasswordInput":"","maxLength":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":""},{"type":"select","id":4,"label":"Note Belongs","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","inputs":null,"choices":[{"text":"First Choice","value":"First Choice","isSelected":false,"price":""}],"formId":10,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","visibility":"visible","noDuplicates":false,"defaultValue":"","conditionalLogic":"","productField":"","enablePrice":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"pods_populate_related_items":true,"enableChoiceValue":false,"displayOnly":""},{"type":"text","id":5,"label":"Form_User","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","inputs":null,"formId":10,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","visibility":"visible","noDuplicates":false,"defaultValue":"{user:ID}","choices":"","conditionalLogic":"","productField":"","enablePasswordInput":"","maxLength":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":""},{"type":"textarea","id":3,"label":"Note","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","inputs":null,"formId":10,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","visibility":"visible","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","form_id":"","useRichTextEditor":false,"multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"displayOnly":""}],"version":"2.2.5","id":10,"useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"confirmations":[{"id":"5a705aba34e88","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":"5a705aba249fe","to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}]},"version":"2.2.5"} ```

Pods Package Export

{"meta":{"version":"2.7.1","build":1521833748},"pods":{"3706":{"id":3706,"name":"class_note","label":"Class Notes","description":"","type":"post_type","storage":"meta","object":"","alias":"","fields":{"class_note":{"id":3708,"name":"class_note","label":"Note","description":"","help":"","class":"","type":"wysiwyg","weight":0,"pick_object":"","pick_val":"","sister_id":"","required":"0","wysiwyg_editor":"tinymce","wysiwyg_media_buttons":"1","wysiwyg_oembed":"0","wysiwyg_wptexturize":"1","wysiwyg_convert_chars":"1","wysiwyg_wpautop":"1","wysiwyg_allow_shortcode":"0","pick_post_status":["publish"],"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":"2","unique":"0","wysiwyg_repeatable":"0","wysiwyg_allowed_html_tags":""},"lesson_topic_location":{"id":3707,"name":"lesson_topic_location","label":"Lesson\/Topic Location","description":"","help":"","class":"","type":"text","weight":1,"pick_object":"","pick_val":"","sister_id":"","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","pick_post_status":["publish"],"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":"2","unique":"0","text_repeatable":"0","text_placeholder":""},"not_belong_to":{"id":3869,"name":"not_belong_to","label":"Not belong to","description":"","help":"","class":"","type":"pick","weight":2,"pick_object":"user","pick_val":"","sister_id":"3857","required":"0","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox","pick_allow_add_new":"0","pick_taggable":"0","pick_show_icon":"1","pick_show_edit_link":"1","pick_show_view_link":"1","pick_limit":"0","pick_user_role":[],"pick_post_status":["publish"],"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":"2","unique":"0","default_value":"ok","pick_select_text":"","pick_table_id":"","pick_table_index":"","pick_display":"","pick_where":"","pick_orderby":"","pick_groupby":""}},"show_in_menu":"1","label_singular":"Class Note","public":"1","show_ui":"1","supports_title":"1","supports_editor":"1","publicly_queryable":"1","exclude_from_search":"1","capability_type":"post","capability_type_custom":"class_note","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":"publish","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_bp-email-type":"0","built_in_taxonomies_bp_group_type":"0","built_in_taxonomies_bp_member_type":"0","built_in_taxonomies_category":"0","built_in_taxonomies_feedback_category":"0","built_in_taxonomies_fl-builder-template-category":"0","built_in_taxonomies_fl-builder-template-type":"0","built_in_taxonomies_ia_invited_groups":"0","built_in_taxonomies_ia_invitees":"0","built_in_taxonomies_ld_course_category":"0","built_in_taxonomies_ld_course_tag":"0","built_in_taxonomies_ld_lesson_category":"0","built_in_taxonomies_ld_lesson_tag":"0","built_in_taxonomies_ld_topic_category":"0","built_in_taxonomies_ld_topic_tag":"0","built_in_taxonomies_link_category":"0","built_in_taxonomies_post_tag":"0","built_in_taxonomies_product_cat":"0","built_in_taxonomies_product_shipping_class":"0","built_in_taxonomies_product_tag":"0","built_in_taxonomies_product_type":"0","built_in_taxonomies_product_visibility":"0","built_in_taxonomies_topic-tag":"0","show_in_nav_menus":"1","show_in_admin_bar":"1","pfat_enable":"0","pfat_run_outside_loop":"0","pfat_single":"Notifications","pfat_append_single":"append","pfat_filter_single":"the_content","pfat_append_archive":"append","pfat_filter_archive":"the_content","rest_enable":"0","read_all":"0","write_all":"0","broadcast":{"link":"on","custom_fields":"on","taxonomies":"on","unchecked_child_blogs":""},"built_in_taxonomies_testing":"0","built_in_taxonomies_course_audience":"0"}}} ![mulitple posts created](https://user-images.githubusercontent.com/4359503/37850423-6fac8a9e-2eb1-11e8-9a28-f23799a8b532.JPG)

Related Issues and/or PRs

Todos

WordPress Environment

Debug Information WordPress Version: 4.9.4 PHP Version: 7.0.28-0ubuntu0.16.04.1 MySQL Version: 5.7.21 Server Software: Apache/2.4.18 Your User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 Session Save Path: /home/clevered.azits.net/tmp Session Save Path Exists: Yes Session Save Path Writeable: Yes Session Max Lifetime: 1440 Opcode Cache: Apc: No Memcached: No OPcache: Yes Redis: No Object Cache: APC: No APCu: No Memcache: No Memcached: No Redis: No WPDB Prefix: wp_ WP Multisite Mode: Yes WP Memory Limit: 512M Pods Network-Wide Activated: Yes Pods Install Location: /home/clevered.azits.net/public_html/wp-content/plugins/pods/ Pods Tableless Mode Activated: No Pods Light Mode Activated: No Currently Active Theme: Boss. Child Theme Currently Active Plugins: bbPress: 2.5.14 Beaver Builder Plugin (Pro Version): 2.0.3.2 Beaver Themer: 1.0.3 Boss for LearnDash: 1.2.6 Broadcast: 43 Broadcast 3rd Party Pack: 42.2 BuddyBoss Media: 3.2.2 BuddyBoss Wall: 1.3.2 BuddyPress: 2.9.3 BuddyPress Activity ShortCode: 1.1.3 BuddyPress Edit Activity: 1.0.9 BuddyPress for LearnDash: 1.2.4 BuddyPress Global Search: 1.1.8 BuddyPress Notifications Widget: 1.2.2 FacetWP: 3.1.0 FacetWP - Beaver Builder: 1.0.8 GP Auto Login: 1.3.2 GP Better User Activation: 1.1.3 Gravity Forms: 2.2.5 Gravity Forms User Registration Add-On: 3.9 Gravity Perks: 2.0.3 Hide My WP: 5.5.4 Invite Anyone: 1.3.20 JW Player Plugin: 1.6.1 LearnDash LMS: 2.5.2 LearnDash LMS - Notifications: 1.0 LearnDash LMS Sync: 1.0 LearnDash ProPanel: 2.1.2 LearnDash Ratings, Reviews, and Feedback: 1.1.0 LearnDash WooCommerce Integration: 1.4.0 Pods - Custom Content Types and Fields: 2.7.1 Pods Beaver Themer Add-On: 1.2.1 Pods Gravity Forms Add-On: 1.3 Shortcode in Menus: 3.4 Sticky Menu (or Anything!) on Scroll: 2.1.1 Tech Beaver Tunnel Replacement: Tin Canny LearnDash Reporting: 2.4 Ultimate Addon for Beaver Builder: 1.6.8 Uncanny LearnDash Toolkit: 2.3 Uncanny LearnDash Toolkit Pro: 2.1.9 UpdraftPlus - Backup/Restore: 2.11.21.22 Upload Max File Size: 1.2 WooCommerce: 3.3.3 WP Multisite SSO: 1.0.3 Yoast SEO: 7.0.3
kendellDaniel commented 6 years ago

Hi,

I've added other requirements such as export data from gravity forms, pods and WordPress details but it's not showing up. Is it supposed to show up?

sc0ttkclark commented 6 years ago

I'm not seeing this on my test site with the latest 1.4. Try the latest 1.4 release we're getting ready to put on wordpress.org:

https://github.com/pods-framework/pods-gravity-forms/archive/feature/skc-fixes.zip