Comments

milesw created an issue. See original summary.

milesw’s picture

Status: Active » Needs review
StatusFileSize
new3.01 KB

It seems _apachesolr_attachments_get_all_files() is not actually collecting all files because of the way results get collected in ApachesolrAttachmentsEntityFieldQuery.

Here is a patch.

milesw’s picture

StatusFileSize
new7.24 KB

Hmm, I think the changes in patch #2 are unnecessary. Those changes addressed files missing after reindexing, which has already been resolved in the latest dev.

This patch addresses files missing from the index after saving and updating entities.

The field_attach_OP hooks have been refactored so that:

- All field languages are accounted for (previously field_get_items() was just getting the current/default language)
- Files no longer associated with an entity get cleaned from the index
- Some redundant code gets removed

milesw’s picture

StatusFileSize
new7.17 KB

Small fix to avoid query exceptions.

milesw’s picture

StatusFileSize
new7.17 KB

I should know better than to post patches before thoroughly testing. This one should be good.

dariogcode’s picture

Patch #5 apply clean to 7.x-1.4, also fix issue #1563478: Deleted attachments not being removed from index. Thanks!

vistree’s picture

This patches fixes parts of my problems. But I still have a problem with documents being attached to an old revision (compare with https://www.drupal.org/node/2263267). Can this patch help remove files from index if they are NOT attached to the current revision. Maybe important: I use workbench moderation to handly drafts of a node.