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
344 stars 191 forks source link

fix(admin-form): title prefixes metabox settings not saving multiple values #3259

Closed raftaar1191 closed 6 years ago

raftaar1191 commented 6 years ago

User Story

As an Admin I don't want to get any PHP notices

Current Behavior

I currently getting PHP notices

Expected Behavior

I expect no PHP error

Steps to Reproduce

  1. Setup a new sites import donation from CSV
  2. Enable debug log
  3. See any Donor profile page you will get a PHP error

Visuals

image

image

image

Debug log

[24-May-2018 09:32:08 UTC] PHP Warning: Invalid argument supplied for foreach() in /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php on line 342 [24-May-2018 09:32:08 UTC] PHP Stack trace: [24-May-2018 09:32:08 UTC] PHP 1. {main}() /app/public/wp-admin/edit.php:0 [24-May-2018 09:32:08 UTC] PHP 2. require_once() /app/public/wp-admin/edit.php:10 [24-May-2018 09:32:08 UTC] PHP 3. do_action() /app/public/wp-admin/admin.php:224 [24-May-2018 09:32:08 UTC] PHP 4. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453 [24-May-2018 09:32:08 UTC] PHP 5. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:310 [24-May-2018 09:32:08 UTC] PHP 6. give_donors_page() /app/public/wp-includes/class-wp-hook.php:286 [24-May-2018 09:32:08 UTC] PHP 7. give_render_donor_view() /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php:117 [24-May-2018 09:32:08 UTC] PHP 8. give_donor_view() /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php:283

Environment

WordPress System Info ### WordPress Environment ### Home URL: http://givewplocal.local Site URL: http://givewplocal.local WP Version: 4.9.6 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: ✔ WP Cron: ✔ Language: en_US Permalink Structure: /%year%/%monthnum%/%day%/%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: givewplocal.local TLS Connection: Connection uses TLS 1.2 TLS Connection: Probably Okay Server Info: Apache/2.4.10 (Debian) PHP Version: 7.1.4 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.5.55 - We recommend a minimum MySQL version of 5.6. See: WordPress Requirements Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ gzip: ✔ GD Graphics Library: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Give Configuration ### Give Version: 2.1.4 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: – Test Mode: Enabled Currency Code: USD Currency Position: Before Decimal Separator: . Thousands Separator: , Success Page: http://givewplocal.local/donation-confirmation/ Failure Page: http://givewplocal.local/donation-failed/ Donation History Page: http://givewplocal.local/donation-history/ Give Forms Slug: /donations/ Enabled Payment Gateways: Test Donation, Offline Donation Default Payment Gateway: Test Donation PayPal IPN Verification: Enabled PayPal IPN Notifications: N/A Donor Email Access: Enabled ### Session Configuration ### Give Use Sessions: Enabled Session: Disabled ### Active Give Add-ons ### Give - 2Checkout Gateway: ❌ Unlicensed – by WordImpress – 1.1 Give - Authorize.net Gateway: ❌ Unlicensed – by WordImpress – 1.3.3 Give - AWeber: ❌ Unlicensed – by WordImpress – 1.0.2 Give - Braintree Gateway: ❌ Unlicensed – by WordImpress – 1.2 Give - CCAvenue Gateway: ❌ Unlicensed – by WordImpress – 1.0.1 Give - Constant Contact: ❌ Unlicensed – by WordImpress – 1.2.1 Give - ConvertKit: ❌ Unlicensed – by WordImpress – 1.0.1 Give - Currency Switcher: ❌ Unlicensed – by WordImpress – 1.1 Give - Display Donors: ❌ Unlicensed – by WordImpress, LLC – 1.0 Give - Dwolla Gateway: ❌ Unlicensed – by WordImpress – 1.1.2 Give - Email Reports: ❌ Unlicensed – by WordImpress – 1.1.1 Give - Fee Recovery: ❌ Unlicensed – by WordImpress – 1.6 Give - Form Countdown: ❌ Unlicensed – by WordImpress – 1.0 Give - Form Field Manager: ❌ Unlicensed – by WordImpress – 1.3 Give - Gift Aid: ❌ Unlicensed – by WordImpress – 1.1.1 Give - Google Analytics Donation Tracking: ❌ Unlicensed – by WordImpress – 1.1.4 Give - MailChimp: ❌ Unlicensed – by WordImpress – 1.4 Give - Manual Donations: ❌ Unlicensed – by WordImpress – 1.4 Give - Mollie Gateway: ❌ Unlicensed – by WordImpress – 1.1 Give - Mollie Gateway: ❌ Unlicensed – by WordImpress – 1.1 Give - Paymill Gateway: ❌ Unlicensed – by WordImpress – 1.1 Give - PayPal Pro Gateway: ❌ Unlicensed – by WordImpress – 1.1.4 Give - PDF Receipts: ❌ Unlicensed – by WordImpress – 2.2.5 Give - Recurring Donations: ❌ Unlicensed – by WordImpress – 1.6.1 Give - Stripe Gateway: ❌ Unlicensed – by WordImpress – 2.0.4 Give - Tributes: ❌ Unlicensed – by WordImpress – 1.4.2 Give - Zapier: ❌ Unlicensed – by WordImpress – 1.2 ### Other Active Plugins ### Restrict Content Pro: by Restrict Content Pro Team – 2.9.12 ### Inactive Plugins ### Akismet Anti-Spam: by Automattic – 4.0.3 Beaver Builder Plugin (Lite Version): by The Beaver Builder Team – 2.1.1.3 BuddyPress: by The BuddyPress Community – 3.0.0 Charitable: by WP Charitable – 1.5.14 Debug Bar: by wordpressdotorg – 0.9 Debug Bar Console: by koopersmith – 0.3 Debug Bar Cron: by Zack Tollman, Helen Hou-Sandi – 0.1.2 Debug Bar Extender: by Thorsten Ott, Automattic – 0.5 Developer: by Automattic – 1.2.6 Duplicate Post: by Enrico Battocchi – 3.2.2 Elementor: by Elementor.com – 2.0.12 Email Cop: by Ashfame – 0.1.1 Give - Development Plugin: by Raftaar1191 – 1.0.0 Gravity Forms: by rocketgenius – 2.2.6 Gravity Forms Signature Add-On: by Rocketgenius – 3.4 Loco Translate: by Tim Whitlock – 2.1.3 Log Deprecated Notices: by Andrew Nacin – 0.4 Log Viewer: by Markus Fischbacher – 14.05.04 Monster Widget: by Automattic – 0.3 Polylang: by Frédéric Demarle – 2.3.6 Query Monitor: by John Blackbourn & contributors – 3.0.0 Rewrite Rules Inspector: by Daniel Bachhuber, Automattic – 1.2.1 User Switching: by John Blackbourn – 1.3.0 WooCommerce: by Automattic – 3.4.0-dev WordPress Beta Tester: by Peter Westwood – 1.2.2 WP Hide & Security Enhancer: by Nsp Code – 1.4.9.1 WPide: by Simon @ WPsites – 2.4.0 WPS Hide Login: by WPServeur, NicolasKulka, tabrisrp – 1.3.3 ### Theme ### Name: Twenty Seventeen Version: 1.5 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
raftaar1191 commented 6 years ago

As this issue is being regenerate in Branch Give 2.2 so I have to change the release to 2.2 for this issues

mehul0810 commented 6 years ago

For more information, When you try to save multiple title prefixes in meta box settings, then it will not save the only one setting which needs to be fixed and also make sure that there is no notice generated.

mehul0810 commented 6 years ago

Closing this as it is resolved within PR https://github.com/WordImpress/Give/pull/3354