Problem/Motivation

I receive errors when the view returns no results due to invalid exposed filter values passed through URL parameters. The errors I receive are:

Warning: Attempt to read property "current_page" on null in views_insert_blocks_views_post_render() (line 36 of modules/contrib/views_insert_blocks/views_insert_blocks.module).
Warning: Attempt to read property "options" on null in views_insert_blocks_views_post_render() (line 39 of modules/contrib/views_insert_blocks/views_insert_blocks.module).
Warning: Trying to access array offset on null in views_insert_blocks_views_post_render() (line 39 of modules/contrib/views_insert_blocks/views_insert_blocks.module).

Steps to reproduce

  1. Create a view with an exposed filter (for example tags)
  2. Insert a random block into the view using 'Insert blocks'
  3. Display the view on a page or access it directly via its URL
  4. Change the URL parameter to an invalid or non-existent value
  5. This causes an error to appear

Proposed resolution

Ensure that the variables always have valid values, whether the view has results or not.

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

CommentFileSizeAuthor
#3 3.patch1.73 KBcoretex
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 1.x Comparechanges, plain diff MR !5

Comments

coretex created an issue. See original summary.

coretex’s picture

Assigned: coretex » Unassigned
Status: Active » Needs review
StatusFileSize
new1.73 KB
wotnak’s picture

Status: Needs review » Reviewed & tested by the community
wotnak’s picture

Looks good, will tag a new release shortly.

  • wotnak committed c1f55dd4 on 1.x authored by coretex
    Issue #3538343 by coretex, wotnak: Warning: Attempt to read property "...
wotnak’s picture

Status: Reviewed & tested by the community » Fixed

Merged and released in v1.1.1.

Status: Fixed » Closed (fixed)

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