Problem/Motivation
When setting up the token with `without-some-parameters` or `with-some-parameters` options, we are getting an error on non-existing pages, which should just render a 404 page instead:
TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given in array_intersect_key() (line 104 of modules/contrib/token_url_plus/token_url_plus.module).
Steps to reproduce
- Install this module + Metatag (for example)
- Set a global metatag (e.g. canonical URL) that uses the following token: "[current-page:url-with-query:with-some-parameters:page]"
- Go to the path "/path-does-not-exist"
Proposed resolution
- Make sure the $query variable is an array, before performing array-operations on it.
Comments
Comment #3
svendecabooterPatch file attached for composer-based workflows.
Comment #4
svendecabooterComment #5
aspilicious commentedI have the same problem, can this be committed? Fix seems to be straightforward.
Comment #7
generalredneck