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

Pods form not triggering notifications #5391

Open jaycollier opened 5 years ago

jaycollier commented 5 years ago

Issue Overview

When posts are submitted via the front-end Pods form, notifications are not being triggered through either of these plugins:

https://wordpress.org/plugins/notification/
https://wordpress.org/plugins/bnfw/

Expected Behavior

We would expect all of these notifications to be triggered by Pods form submissions:

CPT Added
CPT Saved as Draft
CPT Published
CPT Updated

Current Behavior

Posts added via the Pods form are not triggering these notifications:

CPT Added
CPT Saved as Draft

Steps to Reproduce (for bugs)

Here’s our live example: https://www.mltn.org/jobs/submit/

This is the shortcode we used on that page:

[pods name="job" form="1" fields="post_title,job_org_name,job_post_date,job_expires_date,job_submittor_name,job_submittor_email,job_submittor_phone,job_apply_link,job_apply_email,job_description”]

We created a staging version and deactivated all plugins except for Pods, a notification plugin, and PostSMTP. We changed the theme to Twenty-Nineteen. The problem persisted

Possible Solution

In this thread — https://wordpress.org/support/topic/no-notification-for-custom-post-type-added/ — suggestions were made regarding triggers.

WordPress Environment

This is the Pods debug information from our staging site with only 3 active plugins.

WordPress Version: 5.2.1

PHP Version: 7.1.30

MySQL Version: 5.6.36

Server Software: Apache/2.4.39 (Unix) mod_hive/6.27 OpenSSL/1.0.1e-fips mod_fastcgi/2.4.6

Your User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36

Session Save Path: /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: Yes
    • Redis: No

WPDB Prefix: (snip)_

WP Multisite Mode: No

WP Memory Limit: 40M

Current Memory Usage: 12.095M

Current Memory Usage (real): 14.000M

Pods Network-Wide Activated: No

Pods Install Location: /home/j(snip)/staging/5/wp-content/plugins/pods/

Pods Tableless Mode Activated: No

Pods Light Mode Activated: No

Currently Active Theme: Twenty Nineteen

Currently Active Plugins:

    • Notification: 6.0.4
    • Pods - Custom Content Types and Fields: 2.7.12
    • Post SMTP: 2.0.2

Pods Package Export (helpful!)

{"meta":{"version":"2.7.12","build":1560436556},"pods":{"13":{"id":13,"name":"job","label":"Jobs","description":"","type":"post_type","storage":"meta","object":"","alias":"","fields":{"job_org_name":{"id":14,"name":"job_org_name","label":"Organization Name","description":"","help":"","class":"","type":"text","weight":0,"pick_object":"","pick_val":"","sister_id":"","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","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":""},"job_post_date":{"id":15,"name":"job_post_date","label":"Post Date","description":"","help":"","class":"","type":"date","weight":1,"pick_object":"","pick_val":"","sister_id":"","required":"1","date_type":"format","date_format":"mdy","date_allow_empty":"1","date_html5":"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","date_repeatable":"0","date_format_custom":"","date_format_custom_js":""},"instructions_for_expires_date":{"id":5637,"name":"instructions_for_expires_date","label":"Instructions for Expires Date field, below","description":"NOTE: The \"Expires Date\" field, below, is for the public listing. Be sure to include expiration date in the upper right to move invisible to the public.","help":"","class":"","type":"boolean","weight":2,"pick_object":"","pick_val":"","sister_id":"","required":"0","pick_post_status":["publish"],"boolean_format_type":"checkbox","boolean_yes_label":"Yes","boolean_no_label":"No","admin_only":"0","restrict_role":"1","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["edit_jobs"],"rest_read":"0","rest_write":"0","rest_pick_response":"array","rest_pick_depth":"2","unique":"0"},"job_expires_date":{"id":16,"name":"job_expires_date","label":"Expires Date","description":"","help":"","class":"","type":"date","weight":3,"pick_object":"","pick_val":"","sister_id":"","required":"1","date_type":"format","date_format":"mdy","date_allow_empty":"1","date_html5":"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","date_repeatable":"0","oembed_enabled_providers_funnyordiecom":"0","oembed_enabled_providers_photobucketcom":"0","oembed_enabled_providers_polldaddycom":"0","date_format_custom":"","date_format_custom_js":""},"job_apply_link":{"id":17,"name":"job_apply_link","label":"Apply Web Link","description":"URL for application information","help":"","class":"","type":"website","weight":4,"pick_object":"","pick_val":"","sister_id":"","required":"0","website_format":"normal","website_allow_port":"0","website_clickable":"0","website_new_window":"0","website_max_length":"255","website_html5":"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","website_repeatable":"0","website_placeholder":""},"job_apply_email":{"id":18,"name":"job_apply_email","label":"Apply Contact Email","description":"Email address to send application materials","help":"","class":"","type":"email","weight":5,"pick_object":"","pick_val":"","sister_id":"","required":"0","email_max_length":"255","email_html5":"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","email_repeatable":"0","oembed_enabled_providers_funnyordiecom":"0","oembed_enabled_providers_photobucketcom":"0","oembed_enabled_providers_polldaddycom":"0","email_placeholder":""},"job_description":{"id":19,"name":"job_description","label":"Job Description","description":"","help":"","class":"","type":"wysiwyg","weight":6,"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":""},"job_submittor_name":{"id":3840,"name":"job_submittor_name","label":"Submittor Name","description":"","help":"","class":"","type":"text","weight":7,"pick_object":"","pick_val":"","sister_id":"","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","oembed_enabled_providers_funnyordiecom":"0","oembed_enabled_providers_photobucketcom":"0","oembed_enabled_providers_polldaddycom":"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","text_repeatable":"0","text_placeholder":""},"job_submittor_email":{"id":3841,"name":"job_submittor_email","label":"Submittor Email","description":"","help":"","class":"","type":"email","weight":8,"pick_object":"","pick_val":"","sister_id":"","required":"1","email_max_length":"255","email_html5":"0","oembed_enabled_providers_funnyordiecom":"0","oembed_enabled_providers_photobucketcom":"0","oembed_enabled_providers_polldaddycom":"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","email_repeatable":"0","email_placeholder":""},"job_submittor_phone":{"id":3842,"name":"job_submittor_phone","label":"Submittor Phone","description":"","help":"","class":"","type":"phone","weight":9,"pick_object":"","pick_val":"","sister_id":"","required":"1","phone_format":"999-999-9999 x999","phone_enable_phone_extension":"1","phone_max_length":"25","phone_html5":"0","oembed_enabled_providers_funnyordiecom":"0","oembed_enabled_providers_photobucketcom":"0","oembed_enabled_providers_polldaddycom":"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","phone_repeatable":"0","phone_placeholder":""}},"show_in_menu":"1","label_singular":"Job","public":"1","show_ui":"1","supports_title":"1","supports_editor":"0","publicly_queryable":"1","exclude_from_search":"0","capability_type":"custom","capability_type_custom":"job","capability_type_extra":"1","has_archive":"0","hierarchical":"0","rewrite":"1","rewrite_with_front":"0","rewrite_feeds":"0","rewrite_pages":"1","query_var":"1","can_export":"1","default_status":"draft","supports_author":"1","supports_thumbnail":"0","supports_excerpt":"0","supports_trackbacks":"0","supports_custom_fields":"0","supports_comments":"0","supports_revisions":"1","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_nav_menus":"1","show_in_admin_bar":"1","pfat_enable":"1","pfat_run_outside_loop":"0","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","name_admin_bar":"Jobs","built_in_taxonomies_counties":"0","pfat_single":"Job detail","built_in_taxonomies_fl-builder-template-category":"0","built_in_taxonomies_fl-builder-template-type":"0"}},"templates":{"Job detail":{"id":92,"name":"Job detail","code":"<p class=\"summary\">{@job_org_name}<\/p>\r\n\r\n<p>Opening posted: {@job_post_date} | Expires: {@job_expires_date}<\/p>\r\n\r\n<p>[if job_apply_link]<a class=\"btn btn-primary active\" href=\"{@job_apply_link}\">Apply via website<\/a>[\/if] [if job_apply_email]<a class=\"btn btn-primary active\" href=\"mailto:{@job_apply_email}\">Apply via email<\/a>[\/if]<\/p>\r\n\r\n<hr \/>\r\n\r\n{@job_description}","type":"template","slug":"job_detail","options":{"_dp_original":"198","_edit_lock":"1555708194:1","_edit_last":"1","type":"template","slug":"trust-detail","udb_link_target":"_self","admin_only":"","restrict_capability":"","capability_allowed":"","pod_reference":"a:1:{s:3:\"pod\";s:0:\"\";}"}},"Job list":{"id":93,"name":"Job list","code":"[before]<table><tr><th>Position title<\/th><th>Organization<\/th><th>Post date<\/th><th>Expires date<\/th><\/tr>[\/before]\r\n<tr><td><a href=\"{@permalink}\"><strong>{@post_title}<\/strong><\/a><\/td><td>{@job_org_name}<\/td><td>{@job_post_date}<\/td><td>{@job_expires_date}<\/td><\/tr>\r\n[after]<\/table>[\/after]\r\n","type":"template","slug":"job_list","options":{"_edit_lock":"1555943982:1","_edit_last":"36","pod_reference":"s:1:\"1\";","type":"template","slug":"job-list"}}}}

Workaround or Alternate Solution Until Bug is Addressed

No workaround found.

Related Issues and/or PRs

Conversation about this bug here: https://wordpress.org/support/topic/no-notification-for-custom-post-type-added/

Otherwise, no workaround found.

issue-label-bot[bot] commented 5 years ago

Issue-Label Bot is automatically applying the label Type: Bug to this issue, with a confidence of 0.93. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

sc0ttkclark commented 5 years ago

Initial review seems to indicate something is going wrong in regards to the Notifications / BNFW plugins in regards to Pods form submit handling in PodsAPI::process_form (and on down the chain to PodsAPI::save_post). Not sure yet where the exact problem lies between the plugins but it will require having those plugins activated to test.

jaycollier commented 5 years ago

While this is being resolved, we are temporarily using Formidable Forms, which natively supports custom post type creation, custom fields, and notifications. (Gravity Forms required an add-on.) Works great with Pods.

jimtrue commented 5 years ago

@jaycollier The add-on in question for Gravity Forms was WRITTEN by Pods, so I don't think that counts as a reason not to use it. Our add-on is the only one that supports editing existing posts and relationship fields. Gravity Forms supports notifications natively as well.

jaycollier commented 5 years ago

Thanks, Jim. We were already using Formidable Lite, so we upgraded to the basic paid version, which is similar in cost to Gravity Forms. We do look forward to moving back to the front-end Pods forms when the bug is fixed.

jaycollier commented 5 years ago

Disregard the following comment.

Notifications for Pod CPT drafts, publishes, and updates with the Better Notifications for WordPress plugin: https://wordpress.org/plugins/bnfw/. The comment was about the Notification – Custom Notifications and Alerts for WordPress plugin: https://wordpress.org/plugins/notification/. I will post this as a support request there.


_Hi. I have found another problem which may be related, but, if not, please recommend whether I should create a new bug report.

The original report was about receiving notifications from front-end Pods form submissions.

Now, I have set up Notification to send emails when a Pods custom post type is added, published, or updated from the editing interface. When setting up the Notification plugin, the CPT appears correctly in its dashboard, but no email is sent when any of those actions occur.

To troubleshoot, I made a duplicate staging copy and deactivated all plugins except Pods, Notification, and Post SMTP (so I could verify emails sent via its log).

Logins, logouts, and standard page and post notifications work. The triggers for the Pod CPT don't send e-mails.

Recommendations? Are others sending notifications when Pods posts are created or updated? If so, is there another method?

Thanks for your assistance. We have a growing team of editors and knowing when authors make updates to posts is critical.

-Jay_

jakubmikita commented 5 years ago

FYI regarding the Notification plugin - I'm the plugin author and we keep our eyes open for this issue. Now when we released the most important features we'll try to tackle this one.