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.

CommentFileSizeAuthor
#3 3509075--error-on-404-2.patch1.75 KBsvendecabooter
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:

Comments

svendecabooter created an issue. See original summary.

svendecabooter’s picture

StatusFileSize
new1.75 KB

Patch file attached for composer-based workflows.

svendecabooter’s picture

Status: Active » Needs review
aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

I have the same problem, can this be committed? Fix seems to be straightforward.

generalredneck’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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