Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
You should have the Access denied page rather than Page not found.
Page not found is showed because the privatemsg_thread_load() is returning FALSE to the menu handler. I changed:
privatemsg.module:272
function privatemsg_thread_load($thread_id, $account = NULL, $start = NULL) {
static $threads = array();
if ((int)$thread_id > 0) {
$thread = array('thread_id' => $thread_id);
if (is_null($account)) {
global $user;
$account = drupal_clone($user);
}
if (!isset($threads[$account->uid])) {
$threads[$account->uid] = array();
}
...
to
function privatemsg_thread_load($thread_id, $account = NULL, $start = NULL) {
static $threads = array();
if ((int)$thread_id > 0) {
$thread = array('thread_id' => $thread_id);
if (is_null($account)) {
global $user;
if ($user->uid === 0) { // if user is anonymus let him fall to access rules rather than the menu handler
return TRUE;
}
$account = drupal_clone($user);
}
if (!isset($threads[$account->uid])) {
$threads[$account->uid] = array();
}
...
Comments
Comment #1
ptmkenny CreditAttribution: ptmkenny commentedPlease supply a git patch.
Comment #1.0
ptmkenny CreditAttribution: ptmkenny commentedadding file/line specs
Comment #2
dunx CreditAttribution: dunx commentedSolution works fine for anonymous, but still get "not found" for a logged in user who's not got access to the privatemsg. Better than it was though :)
Comment #3
blacklabel_tom CreditAttribution: blacklabel_tom commented+1 for this on the 6.x-1.5 version
Comment #4
oadaeh CreditAttribution: oadaeh as a volunteer commentedThis issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-1.x branch (bug fixes only) or the 7.x-2.x branch.
Thank you.