I am using Drupal 7.19. i have the following error in sending the gift to others:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mallbar_demo_13.d7_d7_node_gift' doesn't exist: INSERT INTO {{node_gift}} (nid, sid, rid, comment, time_stamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => 155 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 41 [:db_insert_placeholder_3] => asfsd [:db_insert_placeholder_4] => 1360031080 ) in nodegift_buy_form_submit() (line 464 of /home/mallbar/www/demo13/sites/all/modules/nodegift/nodegift.module).

Comments

drupalprojects’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

I just tried to make a fresh install of nodegift module on a fresh drupal7 install and it works without any errors. Let me know if you still have any issues.
Thanks!

drupalprojects’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Phase10’s picture

I got the same issue. (as the guy over here has, too: https://www.drupal.org/node/2029439)

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db684712556.DruBeyDruBeynode_gift' doesn't exist: INSERT INTO {{node_gift}} (nid, sid, rid, comment, time_stamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => 5 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 7 [:db_insert_placeholder_3] => Testdurchlauf [:db_insert_placeholder_4] => 1496673043 ) in nodegift_send() (Zeile 468 von /homepages/27/d660515749/htdocs/beysite/sites/all/modules/nodegift/nodegift.module).

Problem is, the module is searching for the wrong table. It uses the prefix twice, so it can't find the right one.
(for example d7_d7_node_gift instead of d7_node_gift or in my case DruBey_DruBey_node_gift instead of DruBey_node_gift)

But I don't know where to find the solution.

drupalprojects’s picture

Hmm... Please, check if node_gift table exists in your database. If yes - provide its full name. Also, please, let me know if you have multiple database connections in your settings.php.

Thanks!

Phase10’s picture

Phase10’s picture

Hi there!

the node_gift table exists in my database, it is called "DruBeynode_gift".
There is just one database connection in my settings.php,

$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'db684712556',
'username' => 'myusername',
'password' => 'mypassword',
'host' => 'myhost',
'port' => '',
'driver' => 'mysql',
'prefix' => 'DruBey',
),
),
);
The "User's gift"-page connects to the right table (DruBeynode_gift), just
when I want to buy a gift, it tries to connect to DruBeyDruBeynode_gift.
Don't know why though.

Thanks for your help! :-)

Phase10’s picture

I think I found the solution!

In line 468 of nodegift.module I changed
db_insert("{node_gift}")->fields($fields)->execute();
to
db_insert("node_gift")->fields($fields)->execute();

It works so far. Though I'm still testing.

Phase10’s picture

Status: Closed (cannot reproduce) » Needs review

drupalprojects’s picture

Assigned: Unassigned » drupalprojects
Status: Needs review » Fixed

The issue has been fixed. Thanks all for help.

Status: Fixed » Closed (fixed)

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