Sometimes `$options` parameter in `hook_url_outbound_alter()` implementation may be received with `$options['query']` as `NULL` (in my case, pathlogic module is responsible for that). Line `$options['query'] += drupal_get_destination();` within `helper_url_outbound_alter()` cause to throw "Unsupported operand types" when it happens.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2789953-no-null-query-option.patch | 595 bytes | dave reid |
| #8 | 2789953-no-null-query-option.patch | 560 bytes | dave reid |
| #2 | beware-of-null-value-2789953-2.patch | 570 bytes | junaidpv |
Issue fork pathologic-2789953
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 #2
junaidpvAttached simple patch to fix the issue.
Comment #3
hiraethmarkbCan confirm that this patch works, and resolves the issue when using 7.x-1.9 of the Helper module.
Comment #4
anybodyThank you very much. Could the maintainer perhaps create a new dev or even stable release? The module isn't usable under PHP 7.x currently!
Comment #5
anybodyTested and works! RTBC +1
Comment #6
dave reidI think I need to push back on this. The documentation for the url() method clearly states that the 'query' option should be an array, it does not say that NULL is a valid value:
I think this needs to be addressed in the Pathologic module.
Comment #7
dave reidComment #8
dave reidThis should resolve it.
Comment #9
dave reidCould also use is_array() instead of isset(), or both possibly.
Comment #10
dave reidUpdated to not use the array short-syntax and add a check for is_array().
Comment #11
anybodyConfirming RTBC again for #10, thank you Dave!
Comment #12
mark_fullmerComment #16
mark_fullmerThe merge request in #14 looks like it includes just the same change as the patch in #10, but it's set to merge into master instead of 7.x-3.x. In any case, using the patch in #10 here is sufficient for merging. The code change makes sense and has been RTBC'd.
Merged and setting as "Fixed"!
Comment #17
dwwThanks for cleaning this up. Confirmed this bug doesn't exist in the 8.x-1.x branch.