Updated to latest version and now when use get the error message below
"No path was selected to forward"

Comments

jpsalter’s picture

I just ran into this problem too. Changing the values $_GET['path'] to be $_GET['q'] solves the problem. I don't know what other implications this may have.

/**
 * Form
 */
function forward_page() {
  //print '<pre>'.print_r(menu_get_menu(),1).'</pre>'; exit;
  $nid = NULL;
  if (empty($_GET['q']) || ($_GET['q'] == 'node/0')) {
    return 'No path was selected to forward';
  }
  
  if (!empty($_GET['q'])) {
    $path = drupal_get_normal_path($_GET['path']);
    $ret = preg_match("/^node\/(.*)/i", $path, $matches);
    if ($ret == 1) {
      $nid = $matches[1];
    }
  }
  if (is_numeric($nid)) {
    // we have a node
    $node = node_load(array('nid' => $nid));
    if (!node_access('view', $node)) {
      // Access is denied
      return drupal_access_denied();
    }
    $path = 'node/'.$node->nid;
  } else {
    $args = explode('/', $path);
    if ($args[0] == 'admin') {
      return drupal_access_denied();
    }
    $node = new stdClass();
    $node->title = $path;
  }
  //print "$path - $nid - $node->title"; exit;
  return drupal_get_form('forward_form', $path, $node->title);
}
jpsalter’s picture

Status: Active » Needs review
StatusFileSize
new991 bytes

Patch attached. I've search and replaced all $_GET['path'] to $_GET['q']

jpsalter’s picture

Status: Needs review » Closed (works as designed)

Okay - the problem seems to be that the module has changed the way links are created (it builds its own): forward?path=node/xxx

This sheds some light on the problem.

http://drupal.org/node/320554

Sites that were using old versions of this module and building their own links (mine for example) will now be broken and need to change how the links are created.

paul conolly’s picture

Works for me.

tirdadc’s picture

Regarding the patch in #2: you also need to change the following line in the forward_page() definition if you want the proper path to be forwarded in the email:

<?php
//$ret = preg_match("/^node\/(.*)/i", $path, $matches);
$ret = preg_match("/^forward\/(.*)/i", $path, $matches);
?>

I just tested it, and it works fine now.

emackn’s picture

StatusFileSize
new3.83 KB

Here is a re-roll of both changes off the current dev branch

netsensei’s picture

Status: Closed (works as designed) » Needs review
StatusFileSize
new1.41 KB

Wasn't really happy with the patch in #6. Contains debug code for one.

So here's a re-roll of the patch with these changes:

- changed regular expression
- $_GET['path'] to $_GET['q']

Works for me.

seanr’s picture

Category: bug » support
Priority: Critical » Normal
Status: Needs review » Closed (won't fix)

You need to update how you're generating your links if you're not using the module's automatically generated links. This change was made deliberately because people wanted to forward non-node pages and there needed to be an easier way to handle the paths. The patches attached would revert to the old format and will actually break stuff. Try using Forward's own links or update your theme. Marking this as won't fix.