When I update module from 3.6 to 3.7 my views not working and show alert window - Search results cannot be filtered, please contact site administrator.

In site log this message:

Search results cannot be filtered for view - "my_views", display - "page"

Comments

Zulljin created an issue. See original summary.

zulljin’s picture

Issue summary: View changes
antonio.bertolini’s picture

Hi,
same to me... I think is correlated to

https://www.drupal.org/node/2900984

So, I apply patch #8 but it's not enough. I wrote about it on that issue.

Antonio

nerdcore’s picture

Priority: Normal » Critical

Same issue here and no idea as to cause.

I'm bumping this to Critical since it seems to be completely nonfunctional at this time.

april26’s picture

I'm also having this problem on all facets.

Is it due to this problem: https://www.drupal.org/node/2900984?

kevinquillen’s picture

Priority: Critical » Normal

You need to add an access rule to the View showing the search results.

In my case, the view had "Access: None" - I needed to set it to "Permission: view published content" (basic permission), and the view worked again without this error.

Marking back as normal - it was a change that was introduced in a recent security patch, so the View(s) you have need to be updated.

From the code:

      // We are processing views on demand by name.
      // To do not let abuse this functionality.
      // We can process only that views which have access settings.
      if (!$access) {
        $commands = [
          ajax_command_alert(
            t('Search results cannot be filtered, please contact site administrator.')
          ),
        ];
        watchdog('access denied', 'Search results cannot be filtered for view - "%view_name", display - "%display_id"', [
          '%view_name' => $name,
          '%display_id' => $dis_id,
        ], WATCHDOG_WARNING);
        ajax_facets_send_commands($commands);
      }

Until they find a way to resolve the issue that was linked, setting an access level on the view will resolve this for now.

fox mulder’s picture

#6 doesn't solve the issue for me.
I added access setting to view display ( and cleared all caches ) but the $view->display[$dis_id]->display_options['access'] still does not exist. See the debug code:


function ajax_facets_refresh_facets_content() {
      ...
      // Prepare data to update certain view.
      $name = $received_view['view_name'];
      $dis_id = $received_view['view_display_id'];
      $access = FALSE;
      // Check that access to this display is restricted.
watchdog('ajax_facets_update', $view->name:  . '<pre>' . print_r($view->display[$dis_id]->display_options, true) . '</pre>');
      if (!empty($view->display[$dis_id]->display_options['access'])) {
        ... // if statement returns FALSE

This is a Content pane type view display included into a minipanel

fox mulder’s picture

I think I see...: I added the access setting to view display: Permission: View published content. But this is the default and the setting was not included into display_options after saving the view...

to cut to the chase: make sure the access key exists in the view export in the corresponding view display

shoeman’s picture

I'm having the same problem as @fox mulder. Tried #6 and flushed cache but the same message pops up.
I also have the same line on my export.
$handler->display->display_options['access']['type'] = 'perm';
Is that set correctly or does something need changed?

Reverting back to version 3.6 fixes my facets. But that won't work long term.

eugene.ilyin’s picture

Hello.

The related issue has been fixed and instruction from #6 have to help.

eugene.ilyin’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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