When deleting nodes, users or content types, the associated entries in the bookmark tables are not deleted. This inconsistency doesn't appear to the user as long as one is using views (the joins with the node table take care of eliminating these rows from the result set), but it a simple query to get the bookmark count for a specific user or node will return a wrong number.

This patch simply deletes the orphaned entries using hook_nodeapi, hook_user and hook_node_type when the operation is 'delete'.

CommentFileSizeAuthor
views_bookmark.module0.patch1.4 KBfloretan

Comments

quicksketch’s picture

Status: Needs review » Fixed

Thanks! The nodeapi hook was added a while back, but I hadn't done node_type and user deletion. Committed to 5.x.

Anonymous’s picture

Status: Fixed » Closed (fixed)