If the view access is unrestricted and the users does not have "access content" permission, then an error is displayed in ajax view when using sort, pagination or filter functionality..

  $items['views/ajax'] = array(
  ...
    'access callback' => 'user_access',
    'access arguments' => array('access content'),
  ...
  );

The views module uses "access content" as the permission for the "/views/ajax" menu item - so the ajax callback is getting an access denied response.

repro:
1. remove "access content" permission for anonymous user
2. create a view
- Style: Table (with sortable header)
- Use AJAX: Yes
- Access: Unrestricted
and add block display
3. put the block into region (and display it on every page)
4. logout
5. click on the table header in the view.
result: "An error occurred at /views/ajax."

CommentFileSizeAuthor
#1 views-408894.patch740 bytesdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

FileSize
740 bytes

this patch solves the problem.

dawehner’s picture

Status: Active » Needs review

Update status.

merlinofchaos’s picture

Status: Needs review » Fixed

Makes sense. Committed to both branches.

Status: Fixed » Closed (fixed)

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