impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
340 stars 191 forks source link

fix(admin-donation): ensure updating offline donations from pending to complete doesn't break date #3606

Closed samsmith89 closed 6 years ago

samsmith89 commented 6 years ago

User Story

As a site admin, I want to update my Pending offline donations to Complete without the date being set to 1/1/1970 so that it doesn't break other integrations I have in place.

Current Behavior

I currently have my date structure set to day/month/year in WordPress, and when I update the status of an offline donation it causes the date to be 1/1/1970.

This only happens with the date structure set up this way. Setting it to month/date/year doesn't cause this error.

Expected Behavior

I expect to have the date accurately update regardless of the date structure I have WordPress set to.

Steps to Reproduce

  1. Set WP to day/month/year
  2. Process an offline donation
  3. Change the status to Completed in the Donations page
  4. See the date get set to 1/1/1970

Visuals

screen shot 2018-08-15 at 3 43 43 pm

Related

https://secure.helpscout.net/conversation/597283183/19905?folderId=1823994

Environment

WordPress System Info ### WordPress Environment ### Home URL: http://give.local Site URL: http://give.local WP Version: 4.9.8 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ✔ Language: en_US Permalink Structure: /%postname%/ Show on Front: posts Table Prefix Length: wp_ Table Prefix Length: 3 Table Prefix Status: Acceptable Admin AJAX: Accessible Registered Post Statuses: publish, future, draft, pending, private, trash, auto-draft, inherit, request-pending, request-confirmed, request-failed, request-completed, refunded, failed, revoked, cancelled, abandoned, processing, preapproval, give_subscription ### Server Environment ### Hosting Provider: DBH: localhost, SRV: give.local TLS Connection: Connection uses TLS 1.2 TLS Connection: Probably Okay Server Info: Apache/2.4.10 (Debian) PHP Version: 7.0.3 PHP Post Max Size: 1,000 MB PHP Time Limit: 900 PHP Max Input Vars: 3000 PHP Max Upload Size: 1,000 MB cURL Version: ❌ 7.38.0, OpenSSL/1.0.1t - We recommend a minimum cURL version of 7.40. SUHOSIN Installed: – MySQL Version: 5.6.34 Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ gzip: ✔ GD Graphics Library: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Give Configuration ### Give Version: 2.2.3 Give Cache: Enabled Database Updates: All DB Updates Completed. Give Cache: Enabled Give Cache: ✔New Donation✔Donation Receipt✔New Offline Donation✔Offline Donation Instructions✔New User Registration✔User Registration Information✔Email access✔Daily Email Report✔Weekly Email Report✔Monthly Email Report❌Renewal Receipt Email✔Subscription Cancelled Email❌Subscription Completed Email✔Subscription Reminder Email✔Subscriptions Email Access Upgraded From: 2.2.3 Test Mode: Enabled Currency Code: USD Currency Position: Before Decimal Separator: . Thousands Separator: , Success Page: http://give.local/donation-confirmation/ Failure Page: http://give.local/donation-failed/ Donation History Page: http://give.local/donation-history/ Give Forms Slug: /donations/ Enabled Payment Gateways: Stripe - Credit Card, Test Donation, Authorize.net, Razorpay, Offline Donation Default Payment Gateway: Stripe - Credit Card PayPal IPN Verification: Disabled PayPal IPN Notifications: N/A Donor Email Access: Enabled ### Active Give Add-ons ### Give - Authorize.net Gateway: ✔ Licensed – by WordImpress – 1.4.2 Give - Braintree Gateway: ✔ Licensed – by WordImpress – 1.2.2 Give - CCAvenue Gateway: ✔ Licensed – by WordImpress – 1.0.2 Give - Email Reports: ✔ Licensed – by WordImpress – 1.1.2 Give - Fee Recovery: ✔ Licensed – by WordImpress – 1.7.1 Give - Form Field Manager: ✔ Licensed – by WordImpress – 1.3 Give - MailChimp: ✔ Licensed – by WordImpress – 1.4.1 Give - Manual Donations: ✔ Licensed – by WordImpress – 1.4.1 Give - PayPal Pro Gateway: ✔ Licensed – by WordImpress – 1.1.6 Give - Paytm Gateway: ✔ Licensed – by WordImpress – 1.0 Give - PDF Receipts: ✔ Licensed – by WordImpress – 2.3 Give - Razorpay: ❌ Unlicensed – by WordImpress – 1.2.0 Give - Recurring Donations: ✔ Licensed – by WordImpress – 1.7.2 Give - Stripe Gateway: ✔ Licensed – by WordImpress – 2.0.10 Give - Tributes: ✔ Licensed – by WordImpress – 1.5.0 ### Other Active Plugins ### All-in-One WP Migration: by ServMask – 6.73 Give - Hook Helper: by Ravinder Kumar – 1.0 Sam's Helper Function: by WordImpress – 1.0 WP Business Reviews: by Impress.org – 1.0.0 WPML Media: by OnTheGoSystems – 2.3.5 WPML Multilingual CMS: by OnTheGoSystems – 4.0.5 WPML Sticky Links: by OnTheGoSystems – 1.4.4 WPML String Translation: by OnTheGoSystems – 2.8.5 WPML Translation Management: by OnTheGoSystems – 2.6.5 ### Inactive Plugins ### Duplicate Post: by Enrico Battocchi – 3.2.2 Give - Donation Upsells for WooCommerce: by WordImpress – 1.0.2 Indeed Ultimate Affiliate Pro: by indeed – 1.5 Mailgun: by Mailgun – 1.5.11 Page Builder by SiteOrigin: by SiteOrigin – 2.7.3 ThemeREX Addons: by ThemeREX – 1.6.24 User Role Editor: by Vladimir Garagulya – 4.44 WooCommerce: by Automattic – 3.4.4 WooCommerce Paytm Payment Gateway: by FTI Technologies – 1.0 WooCommerce Paytm Payment Gateway: by Paytm – 0.2 WP Courseware: by Fly Plugins – 4.4.4 WP Rocket: by WP Media – 3.0.5.1 ### Active MU Plugins ### Bypass Login: by Stephen Carnam – 1.1.0 ### Theme ### Name: Twenty Seventeen Version: 1.7 Author URL: https://wordpress.org/ Child Theme: No – If you're modifying Give on a parent theme you didn't build personally, then we recommend using a child theme. See: How to Create a Child Theme
Operating System
  • Platform: Mac OS X
Browser
  • Name: Chrome
raftaar1191 commented 6 years ago

Finding

Getting PHP notices when updating the donation status

Video Link: https://screencast-o-matic.com/watch/cFjvioqwmX

Debug Log

[30-Aug-2018 07:08:46 UTC] PHP Warning: checkdate() expects parameter 1 to be integer, string given in /app/public/wp-includes/functions.php on line 5264 [30-Aug-2018 07:08:46 UTC] PHP Stack trace: [30-Aug-2018 07:08:46 UTC] PHP 1. {main}() /app/public/wp-admin/edit.php:0 [30-Aug-2018 07:08:46 UTC] PHP 2. require_once() /app/public/wp-admin/edit.php:10 [30-Aug-2018 07:08:46 UTC] PHP 3. require_once() /app/public/wp-admin/admin.php:31 [30-Aug-2018 07:08:46 UTC] PHP 4. require_once() /app/public/wp-load.php:37 [30-Aug-2018 07:08:46 UTC] PHP 5. require_once() /app/public/wp-config.php:93 [30-Aug-2018 07:08:46 UTC] PHP 6. do_action() /app/public/wp-settings.php:450 [30-Aug-2018 07:08:46 UTC] PHP 7. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453 [30-Aug-2018 07:08:46 UTC] PHP 8. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:310 [30-Aug-2018 07:08:46 UTC] PHP 9. give_post_actions() /app/public/wp-includes/class-wp-hook.php:286 [30-Aug-2018 07:08:46 UTC] PHP 10. do_action() /app/public/wp-content/plugins/Give/includes/actions.php:80 [30-Aug-2018 07:08:46 UTC] PHP 11. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453 [30-Aug-2018 07:08:46 UTC] PHP 12. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:310 [30-Aug-2018 07:08:46 UTC] PHP 13. give_update_payment_details() /app/public/wp-includes/class-wp-hook.php:286 [30-Aug-2018 07:08:46 UTC] PHP 14. Give_Payment->save() /app/public/wp-content/plugins/Give/includes/admin/payments/actions.php:85 [30-Aug-2018 07:08:46 UTC] PHP 15. wp_update_post() /app/public/wp-content/plugins/Give/includes/payments/class-give-payment.php:956 [30-Aug-2018 07:08:46 UTC] PHP 16. wp_insert_post() /app/public/wp-includes/post.php:3746 [30-Aug-2018 07:08:46 UTC] PHP 17. wp_checkdate() /app/public/wp-includes/post.php:3296 [30-Aug-2018 07:08:46 UTC] PHP 18. checkdate() /app/public/wp-includes/functions.php:5264 [30-Aug-2018 07:08:46 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /app/public/wp-includes/functions.php:5264) in /app/public/wp-includes/pluggable.php on line 1219 [30-Aug-2018 07:08:46 UTC] PHP Stack trace: [30-Aug-2018 07:08:46 UTC] PHP 1. {main}() /app/public/wp-admin/edit.php:0 [30-Aug-2018 07:08:46 UTC] PHP 2. require_once() /app/public/wp-admin/edit.php:10 [30-Aug-2018 07:08:46 UTC] PHP 3. require_once() /app/public/wp-admin/admin.php:31 [30-Aug-2018 07:08:46 UTC] PHP 4. require_once() /app/public/wp-load.php:37 [30-Aug-2018 07:08:46 UTC] PHP 5. require_once() /app/public/wp-config.php:93 [30-Aug-2018 07:08:46 UTC] PHP 6. do_action() /app/public/wp-settings.php:450 [30-Aug-2018 07:08:46 UTC] PHP 7. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453 [30-Aug-2018 07:08:46 UTC] PHP 8. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:310 [30-Aug-2018 07:08:46 UTC] PHP 9. give_post_actions() /app/public/wp-includes/class-wp-hook.php:286 [30-Aug-2018 07:08:46 UTC] PHP 10. do_action() /app/public/wp-content/plugins/Give/includes/actions.php:80 [30-Aug-2018 07:08:46 UTC] PHP 11. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453 [30-Aug-2018 07:08:46 UTC] PHP 12. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:310 [30-Aug-2018 07:08:46 UTC] PHP 13. give_update_payment_details() /app/public/wp-includes/class-wp-hook.php:286 [30-Aug-2018 07:08:46 UTC] PHP 14. wp_safe_redirect() /app/public/wp-content/plugins/Give/includes/admin/payments/actions.php:373 [30-Aug-2018 07:08:46 UTC] PHP 15. wp_redirect() /app/public/wp-includes/pluggable.php:1305 [30-Aug-2018 07:08:46 UTC] PHP 16. header() /app/public/wp-includes/pluggable.php:1219