All tables should use curly brackets.

For example:

$query = db_query("SELECT fm.* FROM file_managed AS fm ...

Should be:

$query = db_query("SELECT fm.* FROM {file_managed} AS fm ...

If you use prefixed tables with the current code:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'file_managed' doesn't exist: SELECT fm.* FROM file_managed AS fm LEFT OUTER JOIN file_usage AS fu ON (fm.fid = fu.fid) LEFT OUTER JOIN node AS n ON (fu.id = n.nid) WHERE fu.type = 'node' AND n.nid IS NULL; Array ( ) a FancyFileDeleteOrphanFileFilter->query() (línia 25 de /var/local/html/drupal7/node1/sites/transparencia.diba.cat/modules/contrib/fancy_file_delete/views/inc/FancyFileDeleteOrphanFileFilter.inc).
CommentFileSizeAuthor
#5 2736623-5.patch1.52 KBoriol_e9g
#3 curly-2736623-3.patch859 bytesoriol_e9g
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

oriol_e9g created an issue. See original summary.

oriol_e9g’s picture

Issue summary: View changes
oriol_e9g’s picture

Status: Needs work » Needs review
FileSize
859 bytes
labboy0276’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#2721831: field collection images were being deleted by accident

Thanks, I actually fixed this in this issue: https://www.drupal.org/node/2721831

oriol_e9g’s picture

Status: Closed (duplicate) » Needs review
FileSize
1.52 KB

The last version it's not solving the problem. The curly bracket arround node table is missing.

This is the patch to fix it.

labboy0276’s picture

Status: Needs review » Closed (fixed)

Good catch, thanks for the patch, committed to dev.