Apache Solr Attachments module gives you the ability to search the contents of files. Would it be possible to diff attachment contents if we could extract the content of the attachments?

Comments

Alan D.’s picture

Yes.

At a guess, you can use the two alter calls to populate an additional item in the row with content:

      // Allow other modules to act safely on behalf of the core field module.
      drupal_alter('field_diff_view', $old_values, $old_items, $old_context);
      drupal_alter('field_diff_view', $new_values, $new_items, $new_context);

As long as the files are fairly small, you can just add on the contents as another value item ($old_values is just an unindexed array from memory). Or split the file based on its line ending if really large, adding multiple value items.

Or implement your own hook_entity_diff() to create a completely new field to insert into the Diff output.

Alan D.’s picture

Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.