In my current project we have build a module to add custom filters and export functionality in a Solr based views. After some time we have decided to add support to a custom entity and create a custom Solr dashboard/export for this entity too.
The problem is that we used hook_apachesolr_query_alter to handle our custom filters and in this hook there is no information about which views the ApachesolrViewsSolrBaseQuery object is related.
In order to be able to check the view name and display, I've updated the ApachesolrViewsSolrBaseQuery class to include the view object and provide a getter callback so we can get any information we want from the query related view.
$view = $query->getView();
Comments
Comment #1
luizsgpetri commentedComment #2
luizsgpetri commentedComment #3
luizsgpetri commentedComment #5
luizsgpetri commentedComment #6
luizsgpetri commentedComment #7
luizsgpetri commentedComment #8
luizsgpetri commentedNew patch
Comment #11
miroslavbanov commentedApplied patch. Only change is passing
array()instead of''to$context.Thanks for the contribution.
Comment #12
miroslavbanov commentedOops incorrect status.
Just for the record. For the purposes of checking view name and display,
$contextargument would be perfectly good (and conceptually correct), but by passing the view, other things can also be done - like checking arguments that are passed, or even looking at thecontextof the view itself.Comment #14
miroslavbanov commentedActually decided to add context as well.
Comment #16
luizsgpetri commentedComment #17
luizsgpetri commentedComment #18
luizsgpetri commented