I'm trying to create a 'popup' PURL, so that I can pop things up in a window, and theme them a little differently but not have to worry about keeping track of the fact that it is in a popup window.

So I'd like to be able to popup:
/popup/node/123/edit
and for it to show the node edit form.

I've got a module that should set up the PURL properly:


/**
 * Implementation of hook_purl_provider().
 */
function MODULENAME_purl_provider() {
  $items = array();
  $items['MODULENAME'] = array(
    'name' => t('Popups'),
    'description' => t('Is the window a popup window.'),
    // TODO: This callback should set the page template:
    'callback' => 'MODULENAME_this_is_a_popup',
    //'callback arguments' => array($type),
    'example' => 'popup',
  );
  return $items;
}

/**
 * Implementation of hook_purl_modifiers().
 */
function MODULENAME_purl_modifiers() {
  $items = array();
  $items['MODULENAME'] = array(
    array('value' => 'popup', 'id' => 1),
  );
  return $items;
}

And it works when I go to any page that is not path aliased, as soon as the path has an alias (i.e. node/123 aliased to: content/my-node) I get a redirection loop. Am I missing something or is PURL fundamentally incompatible with path aliases?

Comments

jmiccolis’s picture

Purl *should* be compatible with path aliases.

Does your alias contain the prefix? What exactly is the path that triggers the redirection loop?

steven jones’s picture

Assigned: Unassigned » steven jones

Hmmm...it works on one site, but not another.

The site it works on is not running a plain version of Drupal, our silly clients have hacked it to pieces, and probably broken it very badly.

I'll see if I can locate the problem and report back.

steven jones’s picture

The issue is that PURL doesn't like the global redirect module.

steven jones’s picture

Okay turns out global redirect doesn't play nicely with other modules that do custom URL rewriting.

There's a patch that hopes to fix that, but it doesn't work with PURL: #346911: Redirect Loop and custom_url_rewrite ignored

Looks like global redirect inspects the $_REQUEST['q'] string to see if it should redirect to an 'alias'. But PURL has changed $_REQUEST['q'], so it never matches, and voila, redirection loop.

AdrianB’s picture

Subscribing

yhahn’s picture

Status: Active » Closed (duplicate)
socialnicheguru’s picture

The patch mentioned in the other issue does not solve my similar problem of having global redirect enabled :(

I hope there is a fix. For now, I had to disable global redirect.

obrienmd’s picture

I can confirm this is still a problem w/ global redirect.

sebas5384’s picture

me too, this is still happening :(

pfournier’s picture