Problem/Motivation
We have a custom Blob field in one of our field collection on a node. And we want to hook in and display a diff view of that blob under Revisions for a node.
But because field collection do not have a alter hook for field_diff_view for its field (as diff normally has) we can not do it.
Steps to reproduce
- Create a string field for a field collection under a node.
- Create a node and enter value "A" in field collection field.
- Update node an enter value "B" in field collection field.
- Go to view /node/[nid]/revisions and compare last versions
- Create a hook for hook_field_diff_view_alter and see that field_collection field is not triggered in hook
Proposed resolution
Add similar alter hook as Diff module.
See diff.diff.inc and row 148.
drupal_alter('field_diff_view', $new_values, $new_items, $new_context);
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | hook_field_diff_view_alter-3173850-2.patch | 583 bytes | kristofferwiklund |
Comments
Comment #2
kristofferwiklund commentedPatch for adding alter hook.
Comment #3
renatog commentedThis hook on #2 really works well
Comment #5
renatog commentedFixed. Moved to the dev branch
Thank you so much