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?

  • 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 Jul 9 '14 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 Jul 9 '14 at 14:14
  • @Clive , the old method of dpm() with hook_views_pre_render , or something similar. – O V Jul 11 '14 at 7:33
  • Are you sure the admin/reports/views-plugins report won't help you? – Capi Etheriel Jul 24 '14 at 5:42
  • @Clive I never thought I would ever show you something new in Drupal 7. – Capi Etheriel Aug 10 '14 at 5:41
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, privacy policy and cookie policy

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