Hi,

I have installed the latest dev using composer, added the line to the .htaccess file and added my stripe test keys in the config. I then configured the form and submitted it. After entering test stripe card data and submitting the form I get the following error message:

The website encountered an unexpected error. Please try again later.

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbname.give_problem' doesn't exist: SELECT type, detail, timestamp FROM give_problem WHERE donation_uuid = :donation_uuid; Array ( [:donation_uuid] => 8d073f7b-8bd2-443c-bec6-b18e1ce167a3 ) in Drupal\give\ProblemLog::load() (line 74 of modules/contrib/give/src/ProblemLog.php).

I am most grateful for any help you may provide with this. Thanks so much!

Comments

sameer created an issue. See original summary.

sameer’s picture

I have set up my db to have the prefix of 'drupal_'. Could this be why the table is not found? If so, how can this be rectified?

sameer’s picture

Title: Unexpected error on form submission » Use of a database prefix leads to unexpected error on form submission
mlncn’s picture

Priority: Normal » Major

Oh boy, thanks for the report and more thanks for tracking down the problem, sameer!

It sounds like i made a real rookie mistake of forgetting a couple curly braces { } around the database name in a select statement. (I don't think it's possible to screw this up in the more complex Drupal 8 database layers

Sameer, would you be up for finding that and submitting a patch or merge request with this fix?

  • mlncn committed 692e585 on 8.x-1.x
    Support database prefixing
    
    Add curly braces to SELECT statement.
    
    Fixes...
mlncn’s picture

Assigned: Unassigned » mlncn
Status: Active » Fixed

The original post bug report did in fact provide the precise statement that was failing (ironically, on loading a problem log). Crediting Sameer for the report. A search did not turn up any other SELECT statements for me to have messed up.

Status: Fixed » Closed (fixed)

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