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.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | panels_user_fixes.patch | 3.46 KB | NTAuthority |
Comments
Comment #1
sdboyer commentedUgh. Looks like my attempt at fixing this in alpha2 failed. Great. Back to the drawing board...
Comment #2
scottrigbyWhen there's something to test, I'm in
Comment #3
ilakshmir commentedI also experience this problem! Will be happy to help test a fix.
Comment #4
jseffel commentednode/% also gives me "access denied".
Comment #5
sammos commentedi'm getting same issue with node/%
Comment #6
sammos commentedThis doesn't happen for me with User 1 but it does with all other users.
Comment #7
sammos commentedThis doesn't happen for me with User 1 but it does with all other users.
Comment #8
sdboyer commentedAhh. 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
Comment #9
jeff h commentedThis *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
Comment #10
ilakshmir commentedYes it is user/% that does not work. node/% works for me.
Comment #11
sdboyer commentedPlease 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
Comment #12
ilakshmir commentedsdboyer, 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.
Comment #13
sammos commentedHm. 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.
Comment #14
sammos commentedAh, 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.
Comment #15
NTAuthority commentedAttached 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.
Comment #16
sammos commentedI 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!
Comment #17
sdboyer commentedThanks 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.
Comment #18
Psycnic commentedI'll Be happy to test it when its ready. I'm having the same problem.
Comment #19
Flying Drupalist commentedI can't tell if this is related, but I'm getting this at forum/%
Comment #20
keesee commentedComment #21
TheRec commentedSubscribing. I am also getting this problem with comment/reply/% ... User 1 works bur logged users can't see those pages.
Comment #22
alexpottJust 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.
Comment #23
dave kopecekI 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
Comment #24
notabenem commentedsubscribing
Comment #25
niklp commentedI have similar problems when trying to override a taxonomy term (/taxonomy/term/%) - access denied...
Comment #26
miro_dietikerThe 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.
This WILL PASS ALL ACCESS CHECKS, so again: just use it for demo purposes and till the next alpha is working.
Comment #27
sdboyer commentedSo 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...
Comment #28
sdboyer commentedGoing 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.
Comment #29
summit commentedHi 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
Comment #30
guillaumeduveauHi Summit,
When adding the "taxonomy term" argument do you get
If yes the bug is already reported here : #316253: Broken arguments : Taxonomy term, Vocabulary ID, Node add form and Node edit
Comment #31
guillaumeduveauSummit, 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.
Comment #32
summit commentedSorry to file this issue if it indeed is a duplicate.
Looking forward to a solution!
Greetings, Martijn
Comment #33
guillaumeduveauNo problem. I think it's a duplicate. Do you get the same warning I wrote above ?
Comment #34
summit commentedYep, I got that warning!
Greetings,
Martijn
Comment #35
artscoop commentedHi,
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.
Comment #36
artscoop commentedAfter 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_pathreturns "node/%user_uid_optional"
Comment #37
summit commentedHi Artscoop,
This thread has status duplicate, pleasde continue conversation on: http://drupal.org/node/316253
Great you are looking into this!
greetings,
Martijn