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
- Create a view with an exposed filter (for example tags)
- Insert a random block into the view using 'Insert blocks'
- Display the view on a page or access it directly via its URL
- Change the URL parameter to an invalid or non-existent value
- 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
-
Issue fork views_insert_blocks-3538343
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:
Comments
Comment #3
coretex commentedComment #4
wotnakComment #5
wotnakLooks good, will tag a new release shortly.
Comment #7
wotnakMerged and released in v1.1.1.