file:translatable.database.inc
line: 179
code:

<?php
  db_query
("INSERT INTO {$table} (". implode(',', $fields['columns']) .") VALUES (". implode(',', $fields['types']) .")", $fields['values']);
?>

I have drupal installed with table prefix "demo_" for all tables. Module raises error on new translation submit:

Table node_translatable doen't exists

It happens because according to PHP string variable behavior, after replacing "{$table}" by value of variable $table, PHP engine cleans tags "{" & "}", so, we need to apply this change in code for #translatable module to work with tables with prefixes:

<?php
  db_query
("INSERT INTO {".$table."} (". implode(',', $fields['columns']) .") VALUES (". implode(',', $fields['types']) .")", $fields['values']);
?>

Comments

gildedgod’s picture

The same on 210 line too
- from:

<?php
 
return db_query("UPDATE {$table} SET ". implode(',', $fields['assigns']) ." WHERE ". $fields['where'], $fields['values']);
?>

- to:

<?php
 
return db_query("UPDATE {".$table."} SET ". implode(',', $fields['assigns']) ." WHERE ". $fields['where'], $fields['values']);
?>
sun’s picture

Status:Needs review» Closed (duplicate)

This was already fixed in #244276: doesn't seem to work with db table prefix. You might want to consider updating to the latest development snapshot.