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 &param2=200 is interpreted as a paragraph mark followed by m2=200.

  • The example 'query' parameter should be an associative array rather than a string.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pillarsdotnet’s picture

Title: Correct display error in onscreen PHP Snippet example. » Correct the onscreen PHP Snippet example.
Status: Active » Needs review
FileSize
1.07 KB

Patch.

pillarsdotnet’s picture

Fixed trailing comma.

pillarsdotnet’s picture

Grr... Parenthesis nesting error.

pillarsdotnet’s picture

Issue summary: View changes

Third problem.

rsvelko’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

tested , minor, works.

rsvelko’s picture

quoting: 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.

rsvelko’s picture

Status: Reviewed & tested by the community » Fixed

  • c2a91e8 committed on 6.x-2.x
    Issue #1577904 by rsvelko: Correct the onscreen PHP Snippet example...
rsvelko’s picture

Assigned: Unassigned » rsvelko

Status: Fixed » Closed (fixed)

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