• Resolved davidpotter

    (@davidpotter)


    Sorry for the length of this message. I wanted to provide as much information as I could.

    I’ve installed the GiveWP plugin v2.9.5 on the website for our community theatre company, which is running WordPress 5.6 hosted on HostGator. I’ve got it mostly working, but there are a couple things not working quite right, probably due to my installation or configuration. After getting PayPal Standard set up, Test mode disabled, and testing PayPal with a real donation, I attempted to delete all the test donations and got the following error message:

    There has been a critical error on this website. Please check your site admin email inbox for instructions.

    Unfortunately I didn’t get the email, so I dug in to debug it myself. I installed the WP Debugging plugin which displayed the following message immediately after enabling the plugin:

    Notice: Trying to access array offset on value of type null in /home2/dpotter/public_html/sycamoretreetheatre.org/wp-content/plugins/give/src/PaymentGateways/PayPalCommerce/Models/MerchantDetail.php on line 156

    Then I installed the Query Monitor plugin and with the stack trace found that it was reading the give_paypal_commerce_live_account key from the wp_options table and then attempting to deference the token property as an array. Using phpMyAdmin I was able to determine that the value of that property was N. Here’s the full value from the database:

    a:8:{s:10:"merchantId";N;s:18:"merchantIdInPayPal";N;s:8:"clientId";N;s:12:"clientSecret";N;s:5:"token";N;s:14:"accountIsReady";b:1;s:22:"supportsCustomPayments";N;s:14:"accountCountry";N;}

    Next I activated the WP Debugging plugin and then attempted to delete my test donations. This produced the following output:

    Notice: Array to string conversion in /home2/dpotter/public_html/sycamoretreetheatre.org/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php on line 70

    Fatal error: Uncaught Give\Framework\Database\Exceptions\DatabaseQueryException: Query failed in database in /home2/dpotter/public_html/sycamoretreetheatre.org/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php:32 Stack trace: #0 /home2/dpotter/public_html/sycamoretreetheatre.org/wp-content/plugins/give/src/Framework/Database/DB.php(79): Give\Framework\Database\Exceptions\DatabaseQueryException::create(Array) #1 /home2/dpotter/public_html/sycamoretreetheatre.org/wp-content/plugins/give/src/Framework/Database/DB.php(49): Give\Framework\Database\DB::runQueryWithErrorChecking(Object(Closure)) #2 /home2/dpotter/public_html/sycamoretreetheatre.org/wp-content/plugins/give/src/Revenue/Repositories/Revenue.php(62): Give\Framework\Database\DB::delete(‘wp_give_revenue’, Array, Array) #3 /home2/dpotter/public_html/sycamoretreetheatre.org/wp-content/plugins/give/src/Revenue/Listeners/DeleteRevenueWhenDonationDeleted.php(39): Give\Revenue\Repositories\Revenue->deleteByDonationId(‘308’) #4 [internal fu in /home2/dpotter/public_html/sycamoretreetheatre.org/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php on line 32

    Next I deactivated the WP Debugging plugin, activated the Query Monitor plugin, performed the delete operation, and the following was displayed:

    Fatal error: Uncaught Exception: Query failed in database
    in /home2/dpotter/public_html/sycamoretreetheatre.org/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php on line 32

    Call stack:

    Give\F\D\E\DatabaseQueryException::create()
    wp-content/plugins/give/src/Framework/Database/DB.php:79
    Give\F\D\DB::runQueryWithErrorChecking()
    wp-content/plugins/give/src/Framework/Database/DB.php:49
    Give\F\D\DB::delete()
    wp-content/plugins/give/src/Revenue/Repositories/Revenue.php:62
    Give\R\R\Revenue::deleteByDonationId()
    wp-content/plugins/give/src/Revenue/Listeners/DeleteRevenueWhenDonationDeleted.php:39
    Give\R\L\DeleteRevenueWhenDonationDeleted::__invoke()
    call_user_func_array()
    wp-content/plugins/give/src/Helpers/Hooks.php:37
    Give\H\Hooks::Give\H\{closure}()
    wp-includes/class-wp-hook.php:289
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:311
    WP_Hook::do_action()
    wp-includes/plugin.php:484
    do_action()
    wp-includes/post.php:3090
    wp_delete_post()
    wp-content/plugins/give/includes/payments/functions.php:365
    give_delete_donation()
    wp-content/plugins/give/includes/admin/payments/class-payments-table.php:811
    Give_Payment_History_Table::process_bulk_action()
    wp-content/plugins/give/includes/admin/payments/class-payments-table.php:145
    Give_Payment_History_Table::__construct()
    wp-content/plugins/give/includes/admin/payments/payments-history.php:31
    give_payment_history_page()
    wp-includes/class-wp-hook.php:287
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:311
    WP_Hook::do_action()
    wp-includes/plugin.php:484
    do_action()
    wp-admin/admin.php:259
    require_once()
    wp-admin/edit.php:10

    Not sure if this is related, so I’ll go ahead and mention it. I tried to get the PayPal Donations payment gateway to work after testing the PayPal Standard gateway since there are warnings about PayPal Standard. When I would attempt to make a donation, the UI would display a spinner forever. I haven’t spent time to debug that yet – one step at a time ??.

    Thanks for any help you can give me.
    David

    • This topic was modified 4 years, 3 months ago by davidpotter.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Matt Cromwell

    (@webdevmattcrom)

    HI there,

    I was able to fill out the donation form with test info, and get to the PayPal payment screen with no problems at all:

    So the good news there is it seems you are able to accept donations! That’s what’s MOST important.

    Regarding bulk deleting test donations, the best way to do that is with a built-in Tool we’ve implemented. Go to “Donations > Tools” then click on the “Data” tab. There you’ll see a dropdown with a list of tools you can run. One of them says “Delete all Test Data”. Run that.

    Ideally that will work better than the bulk actions tool.

    If that doesn’t work, please let me know what errors you encounter. In this case the Query Monitor info is not particularly helpful, but error messages are for sure.

    Thread Starter davidpotter

    (@davidpotter)

    Thanks for the reference to the tool. When I click Submit, I am presented with the following message:

    Fatal error: Uncaught Exception: Query failed in database
    in /home2/dpotter/public_html/sycamoretreetheatre.org/wp-content/plugins/give/src/Framework/Database/Exceptions/DatabaseQueryException.php on line 32

    Call stack:

    Give\F\D\E\DatabaseQueryException::create()
    wp-content/plugins/give/src/Framework/Database/DB.php:79
    Give\F\D\DB::runQueryWithErrorChecking()
    wp-content/plugins/give/src/Framework/Database/DB.php:49
    Give\F\D\DB::delete()
    wp-content/plugins/give/src/Revenue/Repositories/Revenue.php:62
    Give\R\R\Revenue::deleteByDonationId()
    wp-content/plugins/give/src/Revenue/Listeners/DeleteRevenueWhenDonationDeleted.php:39
    Give\R\L\DeleteRevenueWhenDonationDeleted::__invoke()
    call_user_func_array()
    wp-content/plugins/give/src/Helpers/Hooks.php:37
    Give\H\Hooks::Give\H\{closure}()
    wp-includes/class-wp-hook.php:289
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:311
    WP_Hook::do_action()
    wp-includes/plugin.php:484
    do_action()
    wp-includes/post.php:3090
    wp_delete_post()
    wp-content/plugins/give/includes/payments/functions.php:365
    give_delete_donation()
    wp-content/plugins/give/includes/admin/tools/data/class-give-tools-delete-test-transactions.php:81
    Give_Tools_Delete_Test_Transactions::get_data()
    wp-content/plugins/give/includes/admin/tools/data/class-give-tools-delete-test-transactions.php:135
    Give_Tools_Delete_Test_Transactions::process_step()
    wp-content/plugins/give/includes/admin/tools/export/export-functions.php:73
    give_do_ajax_export()
    wp-includes/class-wp-hook.php:287
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:311
    WP_Hook::do_action()
    wp-includes/plugin.php:484
    do_action()
    wp-admin/admin-ajax.php:184

    It looks pretty similar to the original error message. Any ideas?

    Thanks for your help,
    David

    Thread Starter davidpotter

    (@davidpotter)

    To see if one of the other plugins was causing a problem, I deactivated all of them except for these, which I don’t feel comfortable deactivating:

    • Akismet Anti-Spam (v4.1.7)
    • Give – Donation Plugin (v2.9.5)
    • Jetpack by WordPress.com (v9.2.1)
    • Query Monitor (v3.6.5)
    • Really Simple SSL (v4.0.5)

    It turns out that the stack track I posted above was displayed by the Query Monitor plugin. When I deactivated that one, the following error message displayed instead:

    There has been a critical error on this website.

    Thread Starter davidpotter

    (@davidpotter)

    Hi @webdevmattcrom,

    Between the holidays and getting COVID, I haven’t been able to work on this problem until now. I was wondering if you’ve had a chance to look at the information I’ve provided and if you could help me get to the bottom of this.

    Thanks,
    David

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Trying to access array offset on value of type null in MerchantDetail.php’ is closed to new replies.