Closed (won't fix)
Project:
Privatemsg
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
26 Sep 2011 at 09:34 UTC
Updated:
26 Jul 2016 at 14:53 UTC
Jump to comment: Most recent
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 commentedPlease supply a git patch.
Comment #1.0
ptmkenny commentedadding file/line specs
Comment #2
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 commented+1 for this on the 6.x-1.5 version
Comment #4
oadaeh 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.