When a default table prefix is defined in the Drupal configuration (settings.php), it is not used when the cronlist and perm tables are created. However, it is used for the other tables.
Additionally, when a file is uploaded, the module attempts to write to 'drupal.dbfm_data'. Unfortunately, it doesn't exist (was created with the table prefix).

Comments

geoff_eagles’s picture

Very interesting! We've never tried using prefixes.
I can understand that there would be issues with dbfm_data. Because the drupal functions were using so much php memory I had to resort to using the mysql commands directly.
I'll have a go with prefixes on a test machine

deltroo’s picture

Curly braces are missing in dbm.install for dbfm_perm and dbfm_cronlist

Replace this line
$ret[] = update_sql("CREATE TABLE `dbfm_perm` (
with
$ret[] = update_sql("CREATE TABLE {dbfm_perm} (

Replace this line
$ret[] = update_sql("CREATE TABLE `dbfm_cronlist` ( `fid` int(10) NOT NULL, ...
with this
$ret[] = update_sql("CREATE TABLE {dbfm_cronlist} ( `fid` int(10) NOT NULL, ...

This will only fix the table creation problem.

I've seen that you're querying mysql directly instead of going through the Drupal db_query function, for some good reason.
In this case, I guess the only option is to manually build table names from the Drupal prefix array in your code.

geoff_eagles’s picture

Thanks for spotting the error with the installer - that was the only thing really worrying me.
I'll add a little code to get any prefix correct for the main data table. It'll be in the next release (which goes into test next week).

deltroo’s picture

I've seen that you've added support for table prefix in the code. Thanks for that !

However, in 5.x-3.4-beta1 the prefix for the user table is not used (line 281 of dbfm.module)

281: $result = db_query("select a.fid, a.fname, a.ftitle, a.fdesc, a.flastmod, a.fdown, a.fauthor, a.uid, b.uid, b.name from {dbfm_file} as a, users as b where (a.uid=b.uid) and a.fmime != 'directory' and a.fparent > -1 order by a.flastmod desc limit 5");

geoff_eagles’s picture

Well spotted Sir!
We've only just started testing so we hadn't come across that one yet. I'll shove the change into CVS some time today.

geoff_eagles’s picture

Status: Active » Closed (fixed)

The next release should carry full support for this feature - the code is currently in test