When a monument_image is deleted, hook_delete is called and should delete related records in file_revisions, along with other records in other tables.

Problem lies with file_revisions. I have created the attached patch to try to fix this but it is not working. It seems that
$result = db_query('SELECT * FROM {files} WHERE nid = %d', $node->nid);
despite the fact that $node->nid is valid and matches what is present in MySQL database prior to deleting.

Can't see where this is failing as yet.

CommentFileSizeAuthor
monument_image_delete.patch.txt2.11 KBgrunthus

Comments

grunthus’s picture

Version: master » 5.x-1.x-dev
Assigned: Unassigned » grunthus
Status: Needs review » Fixed

Fixed in monument_image, v1.5 and monument, v1.13

Anonymous’s picture

Status: Fixed » Closed (fixed)