not sure what i am doing wrong. i have the latest versions of the modules but I get the below error:

user warning: Table 'drp_.pay_activity' doesn't exist query: SELECT SUM(transaction_total) FROM pay_activity WHERE pxid = 1 in /sites/all/modules/pay/includes/handlers/pay_transaction.inc on line 38.

can anyone help me on solving this issue?

Comments

quicksketch’s picture

Hm, odd. Well the first thing to check is to see if the "pay_activity" table exists in the database (since that's what the error says). You may need to run update.php if you've updated the modules recently. A sure-fire fix would be to re-install the Pay module (disable it, then uninstall it at admin/build/modules/uninstall, then enable it again), but that approach will discard your existing Pay data (though Webform stores its information separately, so that will still be intact).

ryanfc78’s picture

I ran update.php and it did not fix the problem so I did disable/uninstall/install Pay and set it back up but still getting the same error. I am using the following module versions:

Webform - 6.x-3.9
Webform Pay - 6.x-1.0-alpha3
Pay - 6.x-1.0
PayPal - 6.x-1.0-alpha2

Should I disable/uninstall all of these and then re-install in a certain order?

ryanfc78’s picture

I disabled/unistalled Pay, PayPal and Webform Pay. I then went and downloaded the same versions again that are listed above which all seem to be the latest version. I then installed Pay and hit save. Then installed PayPal and hit save. Went and configured Pay with the Website Payments Pro settings. Then went back and installed Webform Pay and created the form. I tested the form again and still getting the error. Am I forgetting something or is there a way to just add this table that seems to be missing?

ryanfc78’s picture

ok I went back into the database to make sure the pay_activity table was there and i noticed all tables there started with dr_

So I found the dr_pay_activity table and removed the dr_ just to see what would happen. I then recieved this error:

user warning: Table 'drp_.dr_pay_activity' doesn't exist query: INSERT INTO dr_pay_activity (pxid, pmid, uid, activity, result, total, transaction_total, timestamp, hostname) VALUES (4, 0, 1, 'complete', 1, 1, 1, 1, '') in /includes/common.inc on line 3538.
user warning: Table 'drp_.dr_pay_activity' doesn't exist query: INSERT INTO dr_pay_activity (pxid, pmid, uid, payment_type, activity, result, total, transaction_total, timestamp, hostname, data) VALUES (4, 1, 1, 'visa', 'complete', 0, 1, 0, , '', 'a:5:{s:15:\"response_string\";s:7:\"Failure\";s:13:\"approval_code\";N;s:12:\"avs_response\";N;s:13:\"caav_response\";N;s:17:\"transaction_total\";s:4:\"1.00\";}') in content/includes/common.inc on line 3538.

I have gone back and renamed it to dr_pay_activity and received the error I started this with. Any thoughts?

quicksketch’s picture

Title: getting an error » Pay activity table missing table prefixes
Project: Webform Pay » Pay
Version: 6.x-1.0-alpha3 » 6.x-1.0
Category: support » bug

This means you've found a bug in Pay module. :)

All database queries should wrap their tables in curly brackets (i.e. {table_name}, not table_name), but it looks like Pay module is missing curly braces around one of its queries, which makes it so that single query doesn't properly append you database table prefix of "dr_" before the table name. It's an easy fix to make. I'm moving this issue over to the Pay module for them to take a look at.

WillHall’s picture

includes/handlers/pay_transaction.inc

Find (Line 36)

  function update_status($timestamp = NULL, $force = FALSE) {
    $this->total_paid = db_result(db_query("SELECT SUM(transaction_total)
      FROM pay_activity WHERE pxid = %d", $this->pxid));

Replace with:

  function update_status($timestamp = NULL, $force = FALSE) {
    $this->total_paid = db_result(db_query("SELECT SUM(transaction_total)
      FROM {pay_activity} WHERE pxid = %d", $this->pxid));
allie micka’s picture

Status: Active » Fixed

Fixed. Thanks y'all!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.