I was getting two errors with the search files beta4 module, the first:

Table 'brianab_DB_Backend.node' doesn't exist query: SELECT SUM(i.score * t.count) AS score FROM drupal5_pintmaps_search_index i INNER JOIN drupal5_pintmaps_search_total t ON i.word = t.word INNER JOIN drupal5_pintmaps_files AS f ON f.fid = i.sid LEFT JOIN drupal5_pintmaps_upload u USING (fid) LEFT JOIN node n USING (nid) WHERE f.status = 1 AND (i.word = 'hello') AND i.type = 'file' GROUP BY i.type, i.sid HAVING COUNT(*) >= 1 ORDER BY score DESC LIMIT 0, 1 in /hsphere/local/home/brianab2/pintmaps.com/modules/search/search.module on line 946.

The tables in the query are hard-coded, so if you use custom prefixes for your drupal installation this fails.

Solution:

Change line 118 to:

      $find = do_search($keys, 'file', 'INNER JOIN {files} AS f ON f.fid = i.sid LEFT JOIN {upload} u USING (fid) LEFT JOIN {node} n USING (nid)'. $join1, $conditions1 . (empty($where1) ? '' : ' AND '. $where1), $arguments1, $select2, $join2, $arguments2);

The second error:

Column 'fid' in where clause is ambiguous query: SELECT f.*, d.data, u.nid FROM drupal5_pintmaps_files AS f JOIN drupal5_pintmaps_upload AS u USING(fid) INNER JOIN drupal5_pintmaps_search_dataset AS d ON f.fid = d.sid WHERE fid = 4 in /hsphere/local/home/brianab2/pintmaps.com/sites/default/modules/search_files/search_files_attachments.module on line 136.

the solution:

Change line 135 to:

WHERE f.fid = %d

Comments

EoinBailey’s picture

Make that three issues, line 528 has the same issue as the first one mentioned above [doesn't work with table prefixes]:

Should be:

    $result = db_query("SELECT data FROM {search_dataset} WHERE type = '%s'", $type);