When I click on the "email this page" link on Drupal 6.1 with a logged in user (who is of a role which has permission to use this module), I get the following error:

Access denied

warning: Illegal offset type in isset or empty in /var/www/vhosts/therevival.co.uk/httpdocs/modules/user/user.module on line 509.

You are not authorized to access this page.

Comments

miki_nl’s picture

I had the same problem. The root cause seems to be in forward_menu(). I replaced

  $items['forward/%node'] = array(
    'title'            => 'Forward this page',
    'page callback'    => 'drupal_get_form',
    'page arguments'   => array('forward_form', 1),
    'access'           => 'forward_access',
    'access arguments' => array(1),
    'type'             => MENU_CALLBACK
  );

by

  $items['forward/%node'] = array(
    'title'            => 'Forward this page',
    'page callback'    => 'drupal_get_form',
    'page arguments'   => array('forward_form', 1),
    'access arguments' => array('access forward'),
    'type'             => MENU_CALLBACK
  );

See hook_menu for more information about the structure of the array that this function returns.

Clear the cache after making this change.

naheemsays’s picture

The warning has gone away, but I still get the "Access Denied" error. Using a form on the page instead of a link does send an email...

seanr’s picture

That solution is insufficient, unfortunately, as it overrides the node_access settings. forward_access is what needs to be altered, but it'll take a little more research to figure out how. Also, this module is likely to be completely re-ported from the 5.x version anyway, as there were significant changes made to that branch that aren't reflected in 6.x.

seanr’s picture

Status: Active » Closed (duplicate)

Duplicate of http://drupal.org/node/246431

Please try HEAD or DRUPAL-6--1 from CVS now, I've re-ported everything from DRUPAL-5