I created a panel at user/%, initially I limited it by a particular role. I'm user 1, but removed the role when I received an "Access Denied" on the page. Moved the panel to user/%/panel to see if that helped, it did not. Seems like passing the user id as the context kills the access. Would love some help, or TO help on this if someone can point me in the right direction.

Thx.

CommentFileSizeAuthor
#15 panels_user_fixes.patch3.46 KBNTAuthority

Comments

sdboyer’s picture

Ugh. Looks like my attempt at fixing this in alpha2 failed. Great. Back to the drawing board...

scottrigby’s picture

When there's something to test, I'm in

ilakshmir’s picture

I also experience this problem! Will be happy to help test a fix.

jseffel’s picture

node/% also gives me "access denied".

sammos’s picture

Title: User/% Panels Page Access Always Denied » node/% giving access denied too

i'm getting same issue with node/%

sammos’s picture

Title: node/% giving access denied too » user/% and node/% always Access Denied

This doesn't happen for me with User 1 but it does with all other users.

sammos’s picture

This doesn't happen for me with User 1 but it does with all other users.

sdboyer’s picture

Component: Panel pages » Plugins - arguments
Assigned: Unassigned » sdboyer
Priority: Normal » Critical

Ahh. that's gotta be it - as usual, I forgot to test with a user other than UID = 1. I'll keep this in mind when I head back to the drawing board

jeff h’s picture

This *does* happen for me even when I am user 1.

I initially created a user/% panel and when that didn't work I renamed it to jeff/% and got the same result. So I agree with the original issue that it's the user id context not the URL that is causing the problem.

Jeff

ilakshmir’s picture

Yes it is user/% that does not work. node/% works for me.

sdboyer’s picture

Please take note that there are known issues with the user/% path (actually, more precisely, the uid.inc argument) that will pretty much just plain prevent it from working at all.

/me ducks while pointing at the 'alpha' tag on the release

ilakshmir’s picture

sdboyer, thanks for your response.

I was wondering if this problem is limited to the alpha version and if it will go away in the final one? If not, I will revert back to using version 5.

Thanks.

sammos’s picture

Hm. Well, I have a node/% panel that returns access denied for all users but user 1. As soon as I disable this, the node appears; it's not a permission issue or something. Any ideas about what I'm doing wrong? I guess I must be misconfiguring the panel somehow. Thanks.

sammos’s picture

Ah, here is an error I see when viewing not as user 1, along with the access denied error.

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given in /home/digaid/public_html/sites/all/modules/panels/panels_page/panels_page.module on line 193.

NTAuthority’s picture

Status: Active » Needs review
StatusFileSize
new3.46 KB

Attached is a patch which fixes the menu issue by changing the native path, fixes the access denied issue (which is because explode makes a array with a empty string in it), and fixes the user context panes not working, as a user object is passed instead of a user ID.

sammos’s picture

I just tested this and I have not done a user/% override, but the patch to the panels_page.read.inc file fixed the Access Denied error I was getting for non-user-1 users.

I'm not changing the status since I didn't test the user/% issues.

THANK YOU!

sdboyer’s picture

Thanks for the patch, NTAuthority. Unfortunately, such patches really need to be rolled against CVS, not against the released version. The code in uid.inc has changed to (sort of) ameliorate this problem. In reality, though, the problem goes deeper - your changes in that patch leave it in a half-inconsistent state (the load function property would also need to be changed), but even the changes I've already made don't completely solve the problem.

However, the access stuff does look like a good catch at first glance, so I'll have a look and incorporate what's needed as I can.

Psycnic’s picture

I'll Be happy to test it when its ready. I'm having the same problem.

Flying Drupalist’s picture

I can't tell if this is related, but I'm getting this at forum/%

keesee’s picture

TheRec’s picture

Subscribing. I am also getting this problem with comment/reply/% ... User 1 works bur logged users can't see those pages.

alexpott’s picture

Just to say that for node override panels the patch to the panels_page_access function in panels_page.read.inc post in #15 works a treat for me.

Thanks.

dave kopecek’s picture

I had trouble applying the patch in #15. Tried it against 2.0-alpha2 and 2.x-dev. Here's what I got:

[root@myserver modules]# patch -p0 < panels_user_fixes.patch --verbose --binary
Hmm... Looks like a unified diff to me...
(Stripping trailing CRs from patch.)
The text leading up to this was:
--------------------------
|diff -urp panels/arguments/uid.inc ../modules/panels/arguments/uid.inc
|--- panels/arguments/uid.inc 2008-10-12 08:03:11.000000000 +0200
|+++ ../modules/panels/arguments/uid.inc 2008-10-24 20:30:18.000000000 +0200
--------------------------
Patching file panels/arguments/uid.inc using Plan A...
Hunk #1 succeeded at 18.
Hunk #2 succeeded at 33.
Hmm... The next patch looks like a unified diff to me...
(Stripping trailing CRs from patch.)
The text leading up to this was:
--------------------------
|diff -urp panels/panels_page/panels_page.menu.inc ../modules/panels/panels_page/panels_page.menu.inc
|--- panels/panels_page/panels_page.menu.inc 2008-10-12 08:03:11.000000000 +0200
|+++ ../modules/panels/panels_page/panels_page.menu.inc 2008-10-24 19:33:31.000000000 +0200
--------------------------
Patching file panels/panels_page/panels_page.menu.inc using Plan A...
patch: **** malformed patch at line 42: @@ -197,6 +201,7 @@ function _panels_page_menu_alter(&$callb

notabenem’s picture

subscribing

niklp’s picture

I have similar problems when trying to override a taxonomy term (/taxonomy/term/%) - access denied...

miro_dietiker’s picture

Status: Needs review » Needs work

The patch didn't work for me and is already partially included in -dev as i see.

For those of you who just need it working for presentation purposes, i've found an ugly hack to bypass all access checks and makes panels open.

function panels_page_access($id, $account = NULL) {
 return TRUE;
...

This WILL PASS ALL ACCESS CHECKS, so again: just use it for demo purposes and till the next alpha is working.

sdboyer’s picture

So some of what NTAuthority originally posted is a bit of a munge of two different issues together. However, I'm now tentatively thinking that this ought to be fixed in -dev. I'd REALLY appreciate it if people have a chance to test that notion, though...

sdboyer’s picture

Status: Needs work » Fixed

Going to mark this as fixed. Someone please re-open it if I've missed something and this is still a problem with the current -dev, soon to be the next, hopefully last release of the D6 2.x branch.

summit’s picture

Title: user/% and node/% always Access Denied » taxonomy/term/% (and may be user/% and node/%) always Access Denied
Version: 6.x-2.0-alpha2 » 6.x-2.0-alpha3
Status: Fixed » Active

Hi Sam,

Using alpha3, I have the same error still as #25 (http://drupal.org/node/322140#comment-1128456).
Even being user 1 I got "access denied" with all permissions I set.
All other users also got "access denied"
It looks like an issue with overriding.

Thanks again for going into this. I looked at dev, but same error in dev (29 dec 2008) also.

Greetings,
Martijn

guillaumeduveau’s picture

Hi Summit,

When adding the "taxonomy term" argument do you get

warning: Invalid argument supplied for foreach() in .../includes/form.inc on line 1193

If yes the bug is already reported here : #316253: Broken arguments : Taxonomy term, Vocabulary ID, Node add form and Node edit

guillaumeduveau’s picture

Status: Active » Closed (duplicate)

Summit, as it seems the user and node overrides have been fixed, I think the problem with the taxonomy term override is clearly a duplicate of #316253: Broken arguments : Taxonomy term, Vocabulary ID, Node add form and Node edit. Please change back the status to active instead of duplicate if you haven't the same problems described in #316253: Broken arguments : Taxonomy term, Vocabulary ID, Node add form and Node edit.

summit’s picture

Sorry to file this issue if it indeed is a duplicate.
Looking forward to a solution!
Greetings, Martijn

guillaumeduveau’s picture

No problem. I think it's a duplicate. Do you get the same warning I wrote above ?

summit’s picture

Yep, I got that warning!
Greetings,
Martijn

artscoop’s picture

Hi,

It's hard to find a good topic for my issue, but it seems that I experience the issue described here :

- I've overridden a node display with a panel. (I used node/% as a path for the panel). I've also added an argument, which is Node ID. Everything went fine.

Then I've tried to override a user display. (the path I use is user/%). I've added an argument, called User ID. When I saved, I had this warning :
"warning: array_merge() [function.array-merge]: Argument #1 is not an array in /[root path]/sites/all/modules/panels/panels_page/panels_page.menu.inc on line 216."
And when I try to visit user/*, I get a denied access, whether I am admin or not.

Looks like in
_panels_page_menu_alter(&$callbacks) { ... }
the argument
$callbacks[$metadata->native_path]
should be an array. However, I don't know what the function should do if this is not an array.

I am using Alpha 3.

artscoop’s picture

After a short trip into the code,
it seems that
_panels_page_menu_alter(&$callbacks) { ... }
loops through the contexts.

For the "node ID" context,
$callbacks[$metadata->native_path]
indeed is an array.

However, for the "User ID" context,
$callbacks[$metadata->native_path]
returns nothing, and
$metadata->native_path
returns "node/%user_uid_optional"

summit’s picture

Hi Artscoop,

This thread has status duplicate, pleasde continue conversation on: http://drupal.org/node/316253
Great you are looking into this!
greetings,
Martijn