I was using panels_edit() function and noticed that the destination variable was a string thrown into drupal_goto. This was causing issues with my $destination path since I needed to add some parameters to it.

In includes/display-edit.inc on line 94 it call drupal_goto($destination) which throws an error if I pass any parameters.

I've attached a small patch which allows me to submit an array with the appropriate key/value pair, I've basically added the following:


 if ($destination) {
      if(!is_array($destination))
        return drupal_goto($destination);
      else
        return drupal_goto($destination['path'], $destination['query'], $destination['fragment'], $destination['http_response_code']);
    }

On line 94 of display-edit.inc

Attached is the patch. Please let me know if I should change anything else or if there is a better solution :).

Cheers,
JPL

Comments

merlinofchaos’s picture

Status: Active » Needs review

Setting proper status.

Initial glance looks pretty good. I can't commit this myself (maybe sdboyer can do it) right now as my dev setup is currently filled with tons of IPE cleanup code, but will get to this when I can.

levacjeep’s picture

Also added the same for panel_edit_layout().

Patch attached.

merlinofchaos’s picture

Status: Needs review » Fixed

Since we're doing this in two places, i made it a general utility function to reduce code duplication. I also fixed missing spaces for style, missing braces for style, and added defaults to the array to fix notices.

You might want to look at all these things as code style is important when working with Drupal. =)

Status: Fixed » Closed (fixed)
Issue tags: -panels_edit, -drupal_goto, -$destination

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

avpaderno’s picture

Issue summary: View changes
Issue tags: -panels_edit, -drupal_goto, -$destination