Problem/Motivation

The code in src/Plugin/facets/facet_source/SearchApiDisplay.php that executes a view to allow facets to calculate values does not correctly call $view->preExecute(), meaning that not all hooks are run in the build process, which can unexpectedly alter the behaviour of the underlying view.

Steps to reproduce

Implement hook_views_pre_view to set arguments on a Search API view. Add facets to the View and visit it. You will see the facets calculate their values based on the view without arguments applied.

Proposed resolution

Add $view->preExecute() to the build steps.

Comments

MrDaleSmith created an issue. See original summary.

mrdalesmith’s picture

Patch to add preExecute()

mrdalesmith’s picture

Status: Active » Needs review
leo pitt’s picture

Attached patch which applies to 8.x-1.x.

mkalkbrenner’s picture

Status: Needs review » Needs work

Patch does not apply.

mrinalini9’s picture

Status: Needs work » Needs review

Hi,

I have checked and found that the piece of code in patch #2 is already merged in the 2.0.x branch. So, I think no work is needed here.

Thanks & Regards,
Mrinalini

mkalkbrenner’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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