Closed (fixed)
Project:
Entity Operations
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2013 at 20:03 UTC
Updated:
30 Apr 2013 at 14:30 UTC
This takes a bit of thinking about...
If my entity has an operation which outputs a View, that op is made with the EntityOperationsOperationPageViews handler.
Because this operation exists only by virtue of there existing a Views display of the right type, it's not actually declared in hook_entity_info(), but added in by hook_entity_operations_menu_operations_alter().
Meanwhile, ops can be added to views as links, similarly to the way that for nodes you can add 'view', 'edit', and 'delete' links as fields.
The ops that show a View are not themselves made available to add to (another) View as links.
This is because entity_operations_views_data_alter() only looks at hook_entity_info() data.
Comments
Comment #1
joachim commentedThis will probably best be fixed by the almighty change at #1880078: [meta] striking a balance between the operation handler & its use by an entity type.
Comment #2
joachim commentedThis is doable, but I suspect we won't be able to show the operation view's title as the label for the Views field that links to it, because that would mean views data building a view, and then that would in turn build views data.... hello circularity!
Comment #3
joachim commentedAha, turns out we've got what we need.
Issue #1922722 by joachim: Fixed operations provided by Views displays are not themselves exposed to Views as fields.
Comment #4
joachim commentedEffectively reverted this, because of #1968780: circularity with Views 3.7.
Comment #5
joachim commentedOne way to do this would be instead of declaring a Views field in hook_views_data() for each operation, we declare it once, and then have an option in the handler to pick the operation you want.
This the same technique as http://drupal.org/project/viewfield uses, presumably for the same reason.
Comment #6
joachim commented