7

I know Views can show you an SQL preview, various performance statistics, and other SQL queries performed for live previews; I'm looking for something a bit closer to the bone.

The use case...

I'm writing some custom handlers for various entity/field properties (doesn't matter which types, it's all very generic stuff). I'm trying to get these handlers applied to fields in a Search API view, and the 'standard' method of implementing hook_views_data_alter() and changing the field handlers to the new ones isn't working. I think perhaps because $data['commerce_product']['title'] (for example) isn't what the Search API view actually ends up using, so replacing the handler for the entry does nothing.

So I need to know what fields are using what handlers, and preferably anything else that would help me to understand why Views has chosen one and not the other.

I know I could theoretically do this by looping through the field definitions in a pre_render hook or similar, but I'd rather have a solution in place for this any time I need it, as opposed to having to write/copy code for it every time. It feels like such a thing should exist and that I just haven't come across it yet.

Is there anything either included with, or that can be tacked on to, Views (version 3 specifically) that will help with this?

5
  • 1
    I would take this to the issue queue instead. Because a) you'll more directly reach the people that know Views internals really well, and b) if the answer to your question is no, then maybe said devs need to become aware there are DX use cases for adding such functionality. The question may also be usefully tagged with Drupal or Views version, as Views works markedly differently between the different versions.
    – Letharion
    Commented Jul 9, 2014 at 13:23
  • Thanks @Letharion, I was hoping something already exists and I'm just being blind. If no-one chimes in with a ready-made solution I'll take this over to the views queue
    – Clive
    Commented Jul 9, 2014 at 14:14
  • @Clive , the old method of dpm() with hook_views_pre_render , or something similar. Commented Jul 11, 2014 at 7:33
  • Are you sure the admin/reports/views-plugins report won't help you? Commented Jul 24, 2014 at 5:42
  • @Clive I never thought I would ever show you something new in Drupal 7. Commented Aug 10, 2014 at 5:41

1 Answer 1

2

The admin/reports/views-plugins show a table with every plugin used by Views, noting which views use them. And if you want to figure it out programmatically, you can check the code for that page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.