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

joachim’s picture

joachim’s picture

This 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!

joachim’s picture

Status: Active » Fixed

Aha, 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.

joachim’s picture

Status: Fixed » Active

Effectively reverted this, because of #1968780: circularity with Views 3.7.

joachim’s picture

One 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.

joachim’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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