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: resolve error on pagination of Donor back end pages #3719

Closed Benunc closed 6 years ago

Benunc commented 6 years ago

Bug Report

User Story

As a site admin, I want to be able to navigate to a certain page of the Donors table from the UI so that I don't have to manually type in the query string to the URL.

Current Behavior

When Navigating to Donations > Donors on the back end of the site, I should be able to manually type in a number to this box and press "return" on my keyboard to go to the selected page.

screen shot 2018-10-01 at 10 59 32 am

Instead, I am taken to the same page, with an error:

screen shot 2018-10-01 at 10 58 18 am

The URL on the error page ends in wp-admin/edit.php?post_type=give_forms&page=give-donors&order=DESC&orderby=ID&s&give-messages%5B0%5D=invalid-donor-id when it should read wp-admin/edit.php?post_type=give_forms&page=give-donors&paged=2

Expected Behavior

I expect to not get an error, and for the URL to change correctly.

Bug Type

Steps to Reproduce

  1. Navigate to Donations > Donors on a page with more than 30 donors
  2. Enter the number 2 into the page box, and press return.
  3. See the error.

Related

https://secure.helpscout.net/conversation/674590613/26494/

Acceptance Criteria

Environment

Operating System
  • Platform: Mac OS X
  • Version: 10.11.6
Browser
  • Name: Chrome
  • Version: 69.0.3497.100 (Official Build) (64-bit)
WordPress System Info ### WordPress Environment ### Home URL: https://livegive.wpsteward.com Site URL: https://livegive.wpsteward.com WP Version: 4.9.8 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_8138bfdc07_ Table Prefix Length: 14 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: livegive.wpsteward.com TLS Connection: Connection uses TLS 1.2 TLS Connection: Probably Okay Server Info: Apache/2.4.34 (Unix) OpenSSL/1.0.1f PHP Version: 7.0.32 PHP Post Max Size: 1 GB PHP Time Limit: 30 PHP Max Input Vars: 5000 PHP Max Upload Size: 512 MB cURL Version: ❌ 7.35.0, OpenSSL/1.0.1f - We recommend a minimum cURL version of 7.40. SUHOSIN Installed: – MySQL Version: ❌ 5.5.61 - 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.2.5 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❌Renewal Receipt Email❌Subscription Cancelled Email❌Subscription Completed Email✔Subscription Reminder Email❌Subscriptions Email Access Upgraded From: 2.2.1 Test Mode: Enabled Currency Code: USD Currency Position: After Decimal Separator: . Thousands Separator: , Success Page: https://livegive.wpsteward.com/donation-confirmation/ Failure Page: – Donation History Page: https://livegive.wpsteward.com/donation-history/ Give Forms Slug: /donations/ Enabled Payment Gateways: Test Donation, Stripe - Credit Card, PayPal Payments Pro, Authorize.net, PayPal Standard Default Payment Gateway: Stripe - Credit Card PayPal IPN Verification: Disabled PayPal IPN Notifications: IPN received for #1084 ( 8H4629943X7440214 ) on 09/04/2018 at 15:46. Status VERIFIED Donor Email Access: Disabled ### Active Give Add-ons ### Give - Authorize.net Gateway: ✔ Licensed – by WordImpress – 1.4.3 Give - Form Field Manager: ✔ Licensed – by WordImpress – 1.3 Give - Manual Donations: ✔ Licensed – by WordImpress – 1.4.1 Give - PDF Receipts: ✔ Licensed – by WordImpress – 2.3 Give - Recurring Donations: ✔ Licensed – by WordImpress – 1.8.0 Give - Tributes: ✔ Licensed – by WordImpress – 1.5.0 Give - Zapier: ✔ Licensed – by WordImpress – 1.2.1 ### Other Active Plugins ### Ben's Helper Functions: by BenUNC – Give - Fee Recovery: by GiveWP – 1.7.2 Give - Google Analytics Donation Tracking: by GiveWP – 1.2.1 Give - PayPal Pro Gateway: by GiveWP – 1.2.0 Give - Stripe Gateway: by GiveWP – 2.1.1 Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 7.1.0 User Switching: by John Blackbourn & contributors – 1.3.1 ### Inactive Plugins ### Akismet Anti-Spam: by Automattic – 4.0.8 Email Cop: by Ashfame – 0.1.1 Give - Database HealthCheck: by WordImpress – 0.0.2 Give - Mollie Gateway: by WordImpress – 1.1.1 Hello Dolly: by Matt Mullenweg – 1.6 Page Builder by SiteOrigin: by SiteOrigin – 2.8.2 RegistrationMagic Premium: by Registrationmagic – 3.8.1.7 Restrict Content Pro: by Restrict Content Pro Team – 2.9.10 Series Engine: by Eric Murrell (Volacious) – 2.6.1 SiteOrigin Widgets Bundle: by SiteOrigin – 1.12.1 The GDPR Framework: by Codelight – 1.0.11 WonderPlugin Tabs: by Magic Hills Pty Ltd – 5.8 ### Active MU Plugins ### api-hacks.php: by – ### 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
nishitlangaliya commented 6 years ago

@kevinwhoffman , While reproduce the issue I found undefined index donor_id notice . So I have prepared one video what I found. So first of all I am looking into that and will move forward with acceptance full fill.

https://www.useloom.com/share/4179f15258cf4753be7e1124c8541392

Thanks

nishitlangaliya commented 6 years ago

Slack Call Summary

Participants: @mehul0810 , @nishitlangaliya Topic: Discussion about donor_id undefined notice while reproduce case Result: as per discussion this notice comes because entering the number in input and press enter key triggers delete_bulk_donor action which should not trigger when pressing enter key after add number in pagination input

mehul0810 commented 6 years ago

Re-opening this issue as I can see a PHP notice for ID when jumping to a specific page for the first time.

Steps to reproduce

  1. Go to donors page
  2. Jump to any page
  3. After fixing, follow from step (1)

Possible Solution

https://github.com/impress-org/give/blob/release/2.3.0/includes/admin/donors/class-donor-table.php#L434

Acceptance Criteria

Debug Info

[05-Oct-2018 10:44:04 UTC] PHP Notice: Undefined index: ID in /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php on line 457 [05-Oct-2018 10:44:04 UTC] PHP Stack trace: [05-Oct-2018 10:44:04 UTC] PHP 1. {main}() /app/public/wp-admin/edit.php:0 [05-Oct-2018 10:44:04 UTC] PHP 2. require_once() /app/public/wp-admin/edit.php:10 [05-Oct-2018 10:44:04 UTC] PHP 3. do_action() /app/public/wp-admin/admin.php:224 [05-Oct-2018 10:44:04 UTC] PHP 4. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453 [05-Oct-2018 10:44:04 UTC] PHP 5. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:310 [05-Oct-2018 10:44:04 UTC] PHP 6. call_user_func_array:{/app/public/wp-includes/class-wp-hook.php:286}() /app/public/wp-includes/class-wp-hook.php:286 [05-Oct-2018 10:44:04 UTC] PHP 7. give_donors_page() /app/public/wp-includes/class-wp-hook.php:286 [05-Oct-2018 10:44:04 UTC] PHP 8. give_donors_list() /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php:119 [05-Oct-2018 10:44:04 UTC] PHP 9. Give_Donor_List_Table->prepare_items() /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php:162 [05-Oct-2018 10:44:04 UTC] PHP 10. Give_Donor_List_Table->donor_data() /app/public/wp-content/plugins/Give/includes/admin/donors/class-donor-table.php:515 [05-Oct-2018 10:44:04 UTC] PHP 11. Give_DB_Donors->get_donors() /app/public/wp-content/plugins/Give/includes/admin/donors/class-donor-table.php:324 [05-Oct-2018 10:44:04 UTC] PHP 12. Give_Donors_Query->get_donors() /app/public/wp-content/plugins/Give/includes/class-give-db-donors.php:506 [05-Oct-2018 10:44:04 UTC] PHP 13. Give_Donors_Query->get_sql() /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php:163 [05-Oct-2018 10:44:04 UTC] PHP 14. Give_Donors_Query->get_order_query() /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php:230 [05-Oct-2018 10:44:04 UTC] PHP Notice: Undefined index: ID in /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php on line 457 [05-Oct-2018 10:44:04 UTC] PHP Stack trace: [05-Oct-2018 10:44:04 UTC] PHP 1. {main}() /app/public/wp-admin/edit.php:0 [05-Oct-2018 10:44:04 UTC] PHP 2. require_once() /app/public/wp-admin/edit.php:10 [05-Oct-2018 10:44:04 UTC] PHP 3. do_action() /app/public/wp-admin/admin.php:224 [05-Oct-2018 10:44:04 UTC] PHP 4. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453 [05-Oct-2018 10:44:04 UTC] PHP 5. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:310 [05-Oct-2018 10:44:04 UTC] PHP 6. call_user_func_array:{/app/public/wp-includes/class-wp-hook.php:286}() /app/public/wp-includes/class-wp-hook.php:286 [05-Oct-2018 10:44:04 UTC] PHP 7. give_donors_page() /app/public/wp-includes/class-wp-hook.php:286 [05-Oct-2018 10:44:04 UTC] PHP 8. give_donors_list() /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php:119 [05-Oct-2018 10:44:04 UTC] PHP 9. Give_Donor_List_Table->prepare_items() /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php:162 [05-Oct-2018 10:44:04 UTC] PHP 10. Give_Donor_List_Table->donor_data() /app/public/wp-content/plugins/Give/includes/admin/donors/class-donor-table.php:515 [05-Oct-2018 10:44:04 UTC] PHP 11. Give_DB_Donors->get_donors() /app/public/wp-content/plugins/Give/includes/admin/donors/class-donor-table.php:324 [05-Oct-2018 10:44:04 UTC] PHP 12. Give_Donors_Query->get_donors() /app/public/wp-content/plugins/Give/includes/class-give-db-donors.php:506 [05-Oct-2018 10:44:04 UTC] PHP 13. Give_Donors_Query->get_sql() /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php:170 [05-Oct-2018 10:44:04 UTC] PHP 14. Give_Donors_Query->get_order_query() /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php:230 [05-Oct-2018 10:44:04 UTC] PHP Notice: Undefined index: ID in /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php on line 457 [05-Oct-2018 10:44:04 UTC] PHP Stack trace: [05-Oct-2018 10:44:04 UTC] PHP 1. {main}() /app/public/wp-admin/edit.php:0 [05-Oct-2018 10:44:04 UTC] PHP 2. require_once() /app/public/wp-admin/edit.php:10 [05-Oct-2018 10:44:04 UTC] PHP 3. do_action() /app/public/wp-admin/admin.php:224 [05-Oct-2018 10:44:04 UTC] PHP 4. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453 [05-Oct-2018 10:44:04 UTC] PHP 5. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:310 [05-Oct-2018 10:44:04 UTC] PHP 6. call_user_func_array:{/app/public/wp-includes/class-wp-hook.php:286}() /app/public/wp-includes/class-wp-hook.php:286 [05-Oct-2018 10:44:04 UTC] PHP 7. give_donors_page() /app/public/wp-includes/class-wp-hook.php:286 [05-Oct-2018 10:44:04 UTC] PHP 8. give_donors_list() /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php:119 [05-Oct-2018 10:44:04 UTC] PHP 9. Give_Donor_List_Table->prepare_items() /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php:162 [05-Oct-2018 10:44:04 UTC] PHP 10. Give_Donor_List_Table->get_donor_count() /app/public/wp-content/plugins/Give/includes/admin/donors/class-donor-table.php:517 [05-Oct-2018 10:44:04 UTC] PHP 11. Give_DB_Donors->get_donors() /app/public/wp-content/plugins/Give/includes/admin/donors/class-donor-table.php:363 [05-Oct-2018 10:44:04 UTC] PHP 12. Give_Donors_Query->get_donors() /app/public/wp-content/plugins/Give/includes/class-give-db-donors.php:506 [05-Oct-2018 10:44:04 UTC] PHP 13. Give_Donors_Query->get_sql() /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php:163 [05-Oct-2018 10:44:04 UTC] PHP 14. Give_Donors_Query->get_order_query() /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php:230 [05-Oct-2018 10:44:04 UTC] PHP Notice: Undefined index: ID in /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php on line 457 [05-Oct-2018 10:44:04 UTC] PHP Stack trace: [05-Oct-2018 10:44:04 UTC] PHP 1. {main}() /app/public/wp-admin/edit.php:0 [05-Oct-2018 10:44:04 UTC] PHP 2. require_once() /app/public/wp-admin/edit.php:10 [05-Oct-2018 10:44:04 UTC] PHP 3. do_action() /app/public/wp-admin/admin.php:224 [05-Oct-2018 10:44:04 UTC] PHP 4. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453 [05-Oct-2018 10:44:04 UTC] PHP 5. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:310 [05-Oct-2018 10:44:04 UTC] PHP 6. call_user_func_array:{/app/public/wp-includes/class-wp-hook.php:286}() /app/public/wp-includes/class-wp-hook.php:286 [05-Oct-2018 10:44:04 UTC] PHP 7. give_donors_page() /app/public/wp-includes/class-wp-hook.php:286 [05-Oct-2018 10:44:04 UTC] PHP 8. give_donors_list() /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php:119 [05-Oct-2018 10:44:04 UTC] PHP 9. Give_Donor_List_Table->prepare_items() /app/public/wp-content/plugins/Give/includes/admin/donors/donors.php:162 [05-Oct-2018 10:44:04 UTC] PHP 10. Give_Donor_List_Table->get_donor_count() /app/public/wp-content/plugins/Give/includes/admin/donors/class-donor-table.php:517 [05-Oct-2018 10:44:04 UTC] PHP 11. Give_DB_Donors->get_donors() /app/public/wp-content/plugins/Give/includes/admin/donors/class-donor-table.php:363 [05-Oct-2018 10:44:04 UTC] PHP 12. Give_Donors_Query->get_donors() /app/public/wp-content/plugins/Give/includes/class-give-db-donors.php:506 [05-Oct-2018 10:44:04 UTC] PHP 13. Give_Donors_Query->get_sql() /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php:170 [05-Oct-2018 10:44:04 UTC] PHP 14. Give_Donors_Query->get_order_query() /app/public/wp-content/plugins/Give/includes/donors/class-give-donors-query.php:230
ravinderk commented 6 years ago

@mehul0810 Did you check latest release/2.3. @nishitlangaliya already fixed this bug in https://github.com/impress-org/give/pull/3733

mehul0810 commented 6 years ago

Closing this issue as a part of commit 206723f8 by @ravinderk which fixes the issue which I found while testing in the above comment.