Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The PHP Snippet example displayed in the Destination URL Settings fieldset of admin/user/login_destination
shows the following:
return array('path' => 'node/add/video or alias', 'query' => 'param1=100¶m2=200');.
There are several problems with this:
-
The example
'node/add/video or alias'
is neither a valid Drupal path nor a clear placeholder for one. -
The string
¶m2=200
is interpreted as a paragraph mark followed bym2=200
. -
The example
'query'
parameter should be an associative array rather than a string.
Comment | File | Size | Author |
---|---|---|---|
#3 | login_destination-1577904-3.patch | 1.07 KB | pillarsdotnet |
#2 | login_destination-1577904-2.patch | 1.12 KB | pillarsdotnet |
#1 | login_destination-1577904-1.patch | 1.07 KB | pillarsdotnet |
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedPatch.
Comment #2
pillarsdotnet CreditAttribution: pillarsdotnet commentedFixed trailing comma.
Comment #3
pillarsdotnet CreditAttribution: pillarsdotnet commentedGrr... Parenthesis nesting error.
Comment #3.0
pillarsdotnet CreditAttribution: pillarsdotnet commentedThird problem.
Comment #4
rsvelko CreditAttribution: rsvelko as a volunteer commentedtested , minor, works.
Comment #5
rsvelko CreditAttribution: rsvelko as a volunteer commentedquoting: https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_...
"$query: (optional) A URL-encoded query string to append to the link, or an array of query key/value-pairs without any URL-encoding. Passed to url()."
So both array/string are valid, so in the example i will mention both.
And also I will add a robust handling of array/strings as query strings.
Comment #6
rsvelko CreditAttribution: rsvelko as a volunteer commentedComment #8
rsvelko CreditAttribution: rsvelko as a volunteer commented