I don't know if this issue is the same as the "missing tables"-one, also posted here. I installed this module on a not clean Testing-Installation and the moviedb-Table was not created. After executing the Create-Block of the moviedb.mysql the table was created without any problems and the module is working nearly fine. Somehow, the amazon-link is missing (imdb-link is created correctly).

Thx for great work,
keep on,
greetings from Germany,
Felix Lieb aka YAFA

Comments

YAFA’s picture

Another strange bug occured now. I installed the module on a System with Tableprefix and on creation of a movie, the Prefix isn't used by the "save"-routine. So the SQL-Query searches for moviedb_actors and doesn't find, because its name is PREFIXmoviedb_actors. This concerns the tables moviedb_actors, directors, writers and producers.

If I manually add the prefix in mdb_common.inc, Line 187-207, the save works fine, but the read tries to access PREFIXPREFIXmoviedb_actors and so on.

So, I think, the function moviedb_person_role_to_table($role) doesn't do it's job correctly.

Gtx,
Felix aka YAFA

YAFA’s picture

Priority: Normal » Critical

Forgot to change Priority to critical, since many installations should use prefixes...

YAFA’s picture

I traced back the use of $table to Line 100 (mdb_common.inc). Just implement the Drupal-Table-Prefix there. I actually don't know, how. As Workaround I hardcoded it there.

penwing’s picture

I changed the line (mdb_common.inc:100) to


db_query("INSERT INTO {%s} (mid, pid, weight) VALUES (%d, %d, %d)", $table, $mid, $person_id, $weight);

which has fixed it, but there may be a better way. I'm assuming it may have something to do with the curly braces being specific syntax with regards to variables (a la bash)?

Alex
x x

-eru-’s picture

Status: Active » Needs review

I found another way, change on "mdb_common.inc", line 100 to:

db_query("INSERT INTO {".$table."} (mid, pid, weight) VALUES (%d, %d, %d)", $mid, $person_id, $weight);

it works

penwing’s picture

FWIW same idea as mine above. Only thing I quibble with is the use of mixing string catenation ('...}".$table."{...' with external variables (?) '%d ...", $mid...')

Alex
x x

ultimatedruid’s picture

Status: Needs review » Closed (fixed)