Warning: Attempt to read property "current_page" on null

Created on 28 July 2025, 2 months ago

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

-

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇳🇱Netherlands coretex Deurne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024