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.
I was building out a menu today in Drupal 6 and noticed that you are not allowed to add a "fake" path to a menu. Often times I will build out a menu before nodes even exist so that I can finish up all theming and css on that menu. However, you get the following error when you add some generic string in the path field: "The path 'test' is either invalid or you do not have access to it."
Is this a feature or a bug? If the latter, then this will actually become a big issue for my development process, especially if I want to link to a view with arguments.
Thanks in advance.
cc
Comment | File | Size | Author |
---|---|---|---|
#86 | 190867_testbot_when_are_you_back.patch | 830 bytes | scor |
#81 | 190867-fix-content-creation.patch | 900 bytes | David_Rothstein |
#77 | 190867_path_access.patch | 4.93 KB | chx |
#76 | 190867_path_access.patch | 2.49 KB | chx |
#75 | 190867_path_access.patch | 1.5 KB | chx |
Comments
Comment #1
catchcaroltron, I'm sure this is by design, but it looks like a valid usecase (especially views with arguments).
Comment #2
chx CreditAttribution: chx commentedAs the check does the same as the system does when you load a page, the views+arguments is not a special case. If you want to enhance this then you might want to make the error checking optional and enabled by default.
Comment #3
catchoooh, nice. In that case I'm going to set it to 'by design'. You can always point the menu to absolute urls then change them when you go into production if you need fake menu links.
Comment #4
caroltron CreditAttribution: caroltron commentedJust thought of another usecase...what if I'm using the path redirect module? Will it break here too?
Comment #5
Crell CreditAttribution: Crell commentedSubscribing. path_redirect sounds like it would be a problem, unless the menu checker could check for that, too. That gets into messy territory, though. While I could see ways for path_redirect to get around it, I'm worried that we'll run into other cases where there is no easy way around it.
Comment #6
catchThere was talk of having only one valid alias per page, with the rest doing 301 redirects by default - did that ever get in? If so, path redirect would be deprecated in D6 I guess.
Comment #7
Crell CreditAttribution: Crell commentedI don't recall that getting in, as that would have involved putting the canonical path right on the node. I'm not sure if that would solve the problem here anyway.
I suppose I'd rather Drupal not try to protect me here.
Comment #8
chx CreditAttribution: chx commentedIt would certainly do me good if instead of 'path_redirect module' I would get a proper bug report. I have no time to research what that module is, sorry. I can guess: you want to be able aliases here -- sure, add one line which does the sourcing and stores the Drupal path and add another which displays aliased.
What happened with menu mass aliasing? i18n happened. I can't say there is one definite alias now, as that's language dependent. The new path lookup picks the alias in either the current language or if that does not exist then the language independent version. joining against such a construct is not entirely trivial and I am unsure of the performance results. You are free to try, bench etc. If you need assistance, find me at all the usual places.
Comment #9
gregglesThe path redirect module uses a completely separate table to create, store, and determine redirects.
You should look at hook_init where it selects from its own table that you can see being created in the install file.
Comment #10
chx CreditAttribution: chx commentedComment #11
Crell CreditAttribution: Crell commentedYes, greggles, but if you want to have an item in the Primary Links menu that is a path redirect, the path you enter into the menu item doesn't actually exist. That's the part that I expect to break.
Would a checkbox on the menu settings page be acceptable (given how late in the cycle we are)? I don't see an alternative other than removing the checking all together, because right now this is a regression that would break 3 sites we've built recently. :-)
Comment #12
webernet CreditAttribution: webernet commentedWhy not add a confirm form?
Comment #13
webernet CreditAttribution: webernet commentedComment #14
PasqualleI think all path checkers on admin interface should be optional.
specific problem: It is not possible to create path alias for "user/register" with authenticated user. (the joke is, you can do it with anonymous user)
Comment #15
pwolanin CreditAttribution: pwolanin commented@Pasquelle - access to such links is a different issue (an access issue) that we should deal with separately.
Also, at the moment you can enter any path if you enter the full URL, e.g. http://example/com/fake-path
I think this is a "won't fix".
Comment #16
catch#236915: Cannot create path alias for 'user/login' was duplicate.
Comment #17
gregglesAnd #286683: add alias /register with path -> "invalid or no access" error.
Comment #18
pwolanin CreditAttribution: pwolanin commentedNarrowing the scope of the issue. I would consider any proposal to remove checking the validity of a path a "won't fix", however I think the points raised in http://drupal.org/node/236915 were quite valid that there may not be any reason to check for access to a path as well as its validity when determining whether the current user can make an alias for it.
I think that issue outlined the (minimal code change) needed.
Comment #19
alexanderpas CreditAttribution: alexanderpas commentedhow about an additional permission like.... ignore path validity when creating...
or the following option:
the biggest (or even only) problems are around
/register
and/user/login
, mabye allowing to add aliases for those two to users who have the administer url aliases permissionsComment #20
Damien Tournoud CreditAttribution: Damien Tournoud commentedLet's narrow down the issue a little more, and get this committed.
There is no security implication for this because (1) you can always check if you have access to a path by going there directly, (2) if you have access to the 'administer url aliases' permission, you can do a lot of messing up anyway (like aliasing /logout to something else, exploiting a XSS vulnerability, etc.), so this permission should only be given to trusted users.
Comment #21
moshe weitzman CreditAttribution: moshe weitzman commentedLooks good. Fixes the original problem. This has bugged me too.
Comment #22
Dries CreditAttribution: Dries commentedDamien's patch solves the problem and causes no regressions in our tests. Committed to CVS HEAD. Thanks!
It should probably go into Drupal 6 so I'm lowering the version number. It is Gabor's call ...
Comment #23
Dries CreditAttribution: Dries commentedDamien's patch solves the problem and causes no regressions in our tests. Committed to CVS HEAD. Thanks!
It should probably go into Drupal 6 so I'm lowering the version number. It is Gabor's call ...
Comment #24
chx CreditAttribution: chx commentedRevert please. Good patches linger for months and this one sneaks in six hours without anyone even bothering to answer my comments and problems. Despite I was active in the issue I got no word in the "tested by the community" part. It's not like you would need to wait ages to get a comment from me... why the rush??
So: optional yes but rip it out totally? No way.
Comment #25
Dries CreditAttribution: Dries commentedchx: can you elaborate on the 'no way' part? I'd be happy to rollback the patch if I understand a bit more. Thanks.
Comment #26
chx CreditAttribution: chx commentedDrupal 6 menu system provides a way to consistently access check a path. Whether you go there, get a menu link to the page, administer it -- it's one consistent access check and if that fails you have nothing to do with said path. This is consistent and even rereading the issue I do not see any valid argument for laxing it here. Why again you should have be able to alias a path that you can't access? If it's during development and not existing then this patch does not help you. It only removed an access check...
Pasqualle though has a valid problem here , menu administration has the exception for anonymous users coded for him it just needs to be added here.
Comment #27
Crell CreditAttribution: Crell commentedI can agree that there is logic to not allowing people to create menu links to pages they can't access (403). However, the inability to create menu links to a page that doesn't exist yet (404) is a problem during development. We frequently build out a site skeleton before actual content has even been written. While you can greek some of it (Lorem Ipsum etc.), that's not the case for, say, panels or views. Creating a dummy page node there only to replace it later with a View is a waste of more time than you'd expect. (I speak from experience.)
In production an error check of that sort is a usability feature. I development, an error check of that sort is a usability bug.
Comment #28
chx CreditAttribution: chx commentedSo the patch as committed fixed only the case for 403 not for aliasing 404 pathes. We can get back to 404 once the anon case is fixed which was a) the cause for the patch b) fixing is rather trivial.
Comment #29
Crell CreditAttribution: Crell commentedJust realized another use case: Put a View at /my/path. Create a menu item that points to /my/path/somearg. The path doesn't exist per se, but is absolutely valid. That makes the 404 check a problem even in production, if you ever touch a View after launch.
Comment #30
catch#28 works fine for adding user/login as a menu item. Marking RTBC.
Comment #31
Pasquallethe argument for menu_valid_path() function is quite unusual for me. Is there any other function in core where two different things can be accepted as an argument?
Comment #32
pwolanin CreditAttribution: pwolanin commented@Pasqualle - sadly, yes (see node_load, for example) - but I think we could write a simpler patch without that option (attached).
Comment #33
catchI agree, #32 is cleaner. Also tested it and it works great too.
Comment #34
Pasquallewhy do we use an array argument when only a simple string (path) is necessary? there are only 2 places where this function is called, so I don't see a problem to change it..
but other thing: $form_item['link_title'] value is used inside menu_valid_path() function, so we may need an array argument here. Is it covered when this index (link_title) is not set?
Comment #35
Damien Tournoud CreditAttribution: Damien Tournoud commentedAs noted by Pasqualle, there is a E_ALL error in one branch of menu_valid_path().
On another basis, I still don't understand why we are linking path alias creation to the accessibility of the menu item. After all, someone with 'administer url aliases' can today see, delete and alter all URL aliases, regardless of their access to the corresponding menu items. The only thing that's impossible is to create an alias pointing *to* a menu item the user don't have access to. Does that make any sense?
Comment #36
chx CreditAttribution: chx commentedThe only thing I want is an unsubscribe option. Noone reads or cares of what I write and I won't repeat myself.
Comment #37
Pasqualle#29->#2
and
#35->#2
?
Comment #38
alexanderpas CreditAttribution: alexanderpas commented@chx and all others ;)
I agree with you we need the security check, especially with 403 pages (except the anon cases), but be able for the 404 error to dismiss it when someone has the permission to administer the menu. (and mabye adding some watchdog messages when that menu items get's clicked anyway, by catching the 404 and checking the menu table!)
Comment #39
jwuk CreditAttribution: jwuk commentedI've just found this thread thanks to a pointer from gpk on my query http://drupal.org/node/306922.
I've been banging my brains out on this for over a week in whatever time I have spare. I'm astonished. None of this discussion seems to recognise that this change has silently broken upgrade from 5.x to 6. I've been looking for a bug in the upgrade, quietly dropping my menu items to non-Drupal parts of my site. See http://drupal.org/node/302272 for further detail.
It never occurred to me that this could actually be a 'feature' of 6. I was alerted to that by someone, checked, and sure enough that's how 6 behaves!
PLEASE reconsider this. The default behaviour IMO should be for the security check (strange way to describe it, I'd call it a link to non-Drupal content) to ALLOW making the link, at least for the administrator, preferably for all. If you feel it's useful to control these links then the admin should be able to turn off the ability to make the links.
How many people does this have to burn? I'll bet there's a lot more than you know about if I couldn't find this issue in 9 days of searching and neither could the people who tried to answer my various related questions.
I must apologise for the tone of this, I don't want to sound ungrateful for all the wonderful work that has gone into Drupal. But I do feel I have to try to put the point across in such a way that you can empathise a little with my pain and frustration. Especially seeing that it appears to be regarded as a 7.x issue rather than a serious problem in 6 and in upgrade from 5 to 6.
Comment #40
Damien Tournoud CreditAttribution: Damien Tournoud commentedRevert vandalism. Bugs are fixed in the most current development version and then (and only then) backported.
Comment #41
jwuk CreditAttribution: jwuk commentedGee Damien, calling me a vandal is hardly the nicest way to greet my contribution. OK, so this is the first time I've ever had the courage to post something on a core issue thread and I'm ignorant, but I'm certainly not a deliberate vandal.
Neither am I a muppet sitting on his backside waiting for the priests to fix this. I'd be very happy to hear some discussion, some suggestions of how this would best be fixed (in other words not just fixed to suit me, but fixed so that it also addresses the perceived problems that led to these changes in the first place) and pointers to the parts of the code I should look at.
I'm here to help and to play a part in the community.
Comment #42
catchjwuk, Damien may have been a bit curt, but we have to revert issue statuses very, very often due to people insisting that bugs are being fixed in the 'wrong' place, and it's quite frustrating. Not to mention this issue has already gone a bit wayward a couple of times due to misinformed comments, when the particular fix to the anonymous check is a couple of lines.
If you want to help, either #28 should be tested and marked RTBC, or #32 needs to be re-rolled without the E_ALL error (then tested and marked RTBC).
Comment #43
jwuk CreditAttribution: jwuk commentedThanks Catch, I've learnt a lesson about issue threads. Though if you're being plagued by this often, I guess I won't be the first to suggest the UI needs review, rather than shooting the messengers. Someone sent me http://drupal.org/webchick-wins-best-contributor-open-source-awards and that cartoon is brilliant! :)
I'd like to follow your suggestion and look at #28 and #32, though I'm not sure how much use I'll be. I can't even understand what chx has written in #28, perhaps he should have clarified it rather than posting #36.
I might find it easier to find my way round this stuff if I understood the new menu tables better. Functions are well doc'd in api.drupal.org, thanks to Doxygen, but I'm not getting anywhere with my request http://drupal.org/node/303405 for info on the {menu_links} and {menu_router} tables. My impression is that menu_router is built from menu_links and is only a performance optimisation, it contains no info that isn't in menu_links, but I'm unsure if that's really true.
More generally it would be useful if every table were doc'd somewhere, with both a detailed description of each field and an overview of how the tables are used.
Comment #44
Dave ReidCorrect me if I'm wrong, but the patch in #32, using menu_valid_path will result in a call to menu_get_item in most cases anyway (not used on an external path or a path containing '%') and will return a boolean if ($item && $item['access']), which is what the original patch was trying to not check.
Revised patch that just checks if the user has the permission 'administer menus' (since we assume anyone who can edit the menus knows the paths they're working with) and sets an error message instead of a form error.
Tested and confirmed to work on:
user/login
paththatdoesnotexistyet
Comment #45
Dave ReidPath tests passed 100%. Marking as needs review.
Comment #46
alexanderpas CreditAttribution: alexanderpas commented#44 reviewed - no problems here, another review please!
Comment #47
catchAs far as I understand the issue, someone with 'administer menus' may still not have access to nodes, and hence their paths, due to node_access. So needs work.
Comment #48
jwuk CreditAttribution: jwuk commentedMany thanks, Dave, #44 looks exactly what I need for Drupal 6.
At least, if I were building a new site in 6, it would be, but since it's concerned only with the form I don't see how it would solve the related issue of silently dropping such menu links created in 5.x when upgrading. I'm still trying to figure out the problem in system_update_6021(). But this patch takes me a step forward because I can now build a test example in 6 and see what entries in menu_links/menu_router are needed.
#47 -- perhaps I'm misunderstanding, but this sounds to me like further ambition for functionality within core.
Rereading this thread, there appear to be a variety of use cases being proposed:
And, on a separate dimension, 'unacceptable' might be
Perhaps some site builders really want such fine-grained control (and finer than that could even be proposed, since the menu item creator isn't necessarily the same class of user as the one to whom the menu is displayed).
But I don't see it as the business of core to include such rampant featuritis. If you must, add hooks to allow its implementation externally?
Comment #49
jwuk CreditAttribution: jwuk commented#44 isn't sufficient for me in Drupal 6.4 (the only version I've tried).
Bear in mind that my inexperience may mean I've applied the patch incorrectly, but here's what I find:
I apply the patch.
I go to Administer > Site building > Menus > Navigation > Add item.
I set Path to z/index.htm (this is a legal url on my site, I have a z directory with a .htaccess file in it).
I set menu link title, description, leave other items unchanged and press Save
I get a red warning "The path 'z/index.htm' is either invalid or ...". This is being generated by menu_edit_item_validate() in menu.admin.inc where there is somewhat similar code.
It's interesting to look at this function in api.drupal.org. 7.x looks the same as 6.x (I've not checked line by line). 5 has no such function! 4.6 has the function, but much smaller (and I would argue, better -- I feel it's wrong for core to impose the strict and limited policy that was added for this in 6, but of course that's just my opinion).
There's a third place where this message is generated, system_site_information_settings_validate(), but I've not looked at that. That was also a D6 addition.
I'm not familiar with operator binding precedence in PHP, but if it works the way I imagine, I believe the patch in #44, the first line has a typo, && instead of ||, so it wipes out the error message in all conditions (and would presumably abort if $item were null?). However, wiping out the error message is exactly what I want, so for me this patch is good! :)
Sorry, couldn't resist! Needs someone capable to review it, I meant. But I'd hate to be boring! :)
[update] Actually, I've now restored path.admin.inc to its previous state, and the function path_admin_form_validate() is not generating the error. So for the recipe I give above, this patch isn't relevant.
Thanks guys, I feel I'm getting closer to my move to D6, which I'm really looking forward to.
Comment #50
catchTo make it very, very clear. The focus of this issue is on removing the access check for paths which the 'anonymous' user has access to (i.e. user/login) so that administrators can add links to them via the menu UI. That's it.
All other gripes about menu access check really need to be dealt with in their own issues - if other issues don't exist yet, then it's easy to create them and link from here. That means paths that don't exist, paths (other than anonymous user ones, which are a quirk of the permissions system) which the user doesn't have access to, etc. etc. The more time is spent discussing everything else here, the less chance of fixing this specific issue.
@jwuk: you can use absolute links for paths like that, putting .htm files inside your Drupal folder isn't something core needs to support explicitly, but there's nothing stopping you from doing this at the moment.
Comment #51
jwuk CreditAttribution: jwuk commented@catch:
> @jwuk: you can use absolute links for paths like that, putting .htm files inside your Drupal folder isn't something core needs to support explicitly, but there's nothing stopping you from doing this at the moment.
I don't need to go into why that's unacceptable. If you look around the forums you'll find a ton of people with a variety of reasons.
You clearly want me to go away and stop bothering you. And there was me thinking I was helping. I'm sorry to have wasted your time.
Comment #52
catchjwuk: no, I want this issue to get fixed and backported to 6.x as quickly as possible. That only happens when issues and associated patches remain in scope. A patch to do pretty what you want already went in earlier in this issue without much review, and subsequent discussion and patching has been attempting to revert it to a point where it can be backported. Trying to address the access checks and validation in this issue is a lost cause, you're welcome to keep doing so, but it's counter-productive (as is taking things personally and flouncing ;) ).
I wasn't able to find another issue for removing validation and access checks, so I've opened one: #308263: Allow privileged users to bypass the validation of menu items
Comment #53
chx CreditAttribution: chx commentedLet me try to put this sorrowful piece on track again. There are two issues here.
One of them is allowing to add a path alias to an anonymous - only accessible path. This can be done by calling menu_valid_path as that sets the necessary global. This was deadended by pointing out that there is a possible code track where link_title is not set and this is an E_ALL but that is only fired if you want to add an alias to something like user/%. This is not supported. We can add a simple option to menu_valid_path to disallow.
Moreover, noone took the effort to read the incredibly long list of functions calling menu_valid_path. How hard it is to read two functions? You will quickly find that one of them is system_site_information_settings_validate which calls menu_valid_path and noone whined so far about a) possible E_ALL issue b) not able to set a frontpage to a path disallowed. So it's truly only about expectations, isn't it?
Action plan for someone else because I am not going to code an issue where patches get committed against my comments:
Comment #54
joshuajabbour CreditAttribution: joshuajabbour commentedIn regards to #50-53, this issue very clearly started against the general problem jwuk describes (even though the original issue was a specific use case during development, the real problem was not being able to create a menu item linked to a non-existent path), and was co-opted by the user access check thread (as pointed out in #15). I will be heading over to #308263: Allow privileged users to bypass the validation of menu items and adding in a patch or two from above to that thread, as I'm having the same issues with this core regression. But it seems a little odd to chastise someone and tell them to do what you should have done yourself (opening a new thread for a separate issue).
Comment #55
joshuajabbour CreditAttribution: joshuajabbour commentedRegarding #26, I don't quite understand why a user with administer menus permission would be forbidden from creating a menu item that links to a resource they don't have access to. Just because *I* can't see something, doesn't mean there aren't others who can and I don't have a need to put it in a menu.
It seems the menu system access check is more useful on viewing the menu item, not creating it. If a user doesn't have permission to view a resource, any menu links to that resource shouldn't show up. I'd love an explanation of why this behavior was designed to work this way...
Comment #56
alexanderpas CreditAttribution: alexanderpas commentedin response to #55: you don't want 404 pages in production, they're ugly.
also, you don't want to let a visitor see what paying customers can see, 403 pages are ugly too!
but that is NOT the issue here, see #308263: Allow privileged users to bypass the validation of menu items for that.
this issue is specifically to remove the access check in such way, you're able to create valid, anonymous-only accessible paths.
for any discussion about bypassing the access checks for privileged users, go to: #308263: Allow privileged users to bypass the validation of menu items
(sorry if i'm too harsh, but i'm trying to keep this issue focused!)
Comment #57
chx CreditAttribution: chx commentedwell the poor issue is abandoned and D7 is broken. I am going to fix it as listed above but only if the broken patch that got committed gets reverted. I attached the reverting patch.
Comment #62
catchNo fails in the test results, setting this back.
Comment #63
Dries CreditAttribution: Dries commentedI've rolled back this patch. Let's see what chx can come up with, and compare the different solutions. Thanks chx.
Comment #64
chx CreditAttribution: chx commentedBlocked by #204077: Allow menu links pointing to dynamic paths , so first clean up the menu_valid_path function and then get back here.
Comment #65
amariotti CreditAttribution: amariotti commentedsubscribing...
Comment #66
Dave ReidMoving to the appropriate path.module component.
Comment #67
keithfig CreditAttribution: keithfig commentedThe whole 403 error when a logged in user visits user/login has always seemed completely ridiculous to me and my clients and the users of their websites. Completely unintuitive behaviour from a user (and an admin/developer's) point of view. Can anyone explain the use case/thinking behind this behaviour?
Even more ridiculous is the fact that if I grant anonymous user role permissions that allow an anonymous user to access admin pages and administer menus and path aliases, I can accomplish exactly what I want which is to create a path alias and a menu link to the user/login page and the user/register page - surely this is silly and dangerous?
I would bump this up for a patch to at least address the issue above. From reading this thread, I can't tell if a working patch for this has been provided yet or not? If I'm being silly, please don't hesitate to point it out!
Comment #68
Damien Tournoud CreditAttribution: Damien Tournoud commentedPlease do not change the version information.
Comment #69
emdalton CreditAttribution: emdalton commentedI got here from #470072: Hide broken menu items, instead of removing them, which was marked as a duplicate of this issue, but after reading the whole thread, I don't see that the problem reported there is addressed here. To summarize, if a page is removed or made inaccessible, the menu item pointing to that page is broken, along with all sub-menus attached to it.
Yesterday morning I decided to replace a panel page with a regular page. This panel page parented a major section in my menu structure. I created the new page, unpublished the panel page, and changed the alias I had been using to point to the new page. This would have worked in D5. But in D6 all of a sudden half of my menu was gone. When I checked the menu_links table, the entries were still there, but inaccessible through the menu editing interface. I tried to recreate the missing menu links and had numerous problems with pages not recognizing where in the menu they were supposed to be. After reading #470072, I realized what had probably caused the error, and I just republished the panel page, edited the menu to point to the new page, and unpublished the panel page again. Now all is working normally.
I spent about a day and a half recovering from D6 refusing to display a menu section because one node in it was unpublished. It seems to me that the menu system should have let me see the menu item, but marked as disabled, or something comparable. And I'm not convinced that converting aliases to nodes is helping me, either. I think that should be optional behavior.
So my question is, will this problem be addressed in this issue, or should #470072 be re-opened as a separate issue?
Edited to add: this bug corrupted the whole branch of the menu so that I had to manually re-integrate menu items between the new menu items I had created after the branch mysteriously disappeared, and the old items under the branch once I was able to recover it. Until I manually re-shuffled all the items, none of the pages were able to recognize which menu they belonged to for the purposes of expanding sub-menus or using Block Menu. Whether the bug is to be addressed in this issue or in the one closed as duplicate, I think it does need to be addressed soon, before someone else loses several days worth of work.
Comment #70
spongs CreditAttribution: spongs commentedHas this issue been resolved - is creating an alias directly in the database a possible workaround? I currently have 2 different themes running on my site, I want to use an alias so the registration and login pages use the alternative theme which has been effective for other pages.
Comment #71
spongs CreditAttribution: spongs commentedsee http://drupal.org/node/270788 for workaround solution.
Comment #72
chx CreditAttribution: chx commentedWow guys more than a year passed and noone acted on the battle plan? Here it is again:
Comment #73
rcmaehl CreditAttribution: rcmaehl commentedWhy not just for like 1 minute give 'anonymous user' the permissions to 'create url aliases'.
Comment #74
catchThe check is on a path which only anonymous users have access to (user/login) to see if the current user has access, it doesn't matter who has permissions to create aliases.
Comment #75
chx CreditAttribution: chx commentedExecuting that plan is not particularly difficult.
Comment #76
chx CreditAttribution: chx commentedMakes more sense with the menu.inc hunk :)
Comment #77
chx CreditAttribution: chx commentedAdded doxygen for the new argument and renamed the function to drupal_valid_path and moved to path.inc. Drupal 6 will get a different patch obviously.
Comment #78
Dries CreditAttribution: Dries commentedThis looks good to me, too bad the test bot isn't running. Committed to CVS HEAD.
Comment #79
chx CreditAttribution: chx commented#76 is the one that could be ported. With path not calling menu_valid_path the extra arg might not be necessary after all, it just does what menu_valid_path would do.
Comment #80
chx CreditAttribution: chx commentedComment #81
David_Rothstein CreditAttribution: David_Rothstein commentedI think this issue is now officially a definitive proof of why the testbot is a good thing :)
Comment #82
David_Rothstein CreditAttribution: David_Rothstein commentedAlso seems like this needs documentation since it was an API change.
Comment #83
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis is the correct fix, thanks David.
Comment #84
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #85
catchBack to NW for docs.
Comment #86
scor CreditAttribution: scor commented#77 broke HEAD:
Comment #87
carlos8f CreditAttribution: carlos8f commentedOH NO! chx lost the kittens :(
The test bot is very depressed about that and isn't in the mood to review anything. Let's fix that by committing #86.
http://qa.drupal.org/pifr/test/33
Comment #88
carlos8f CreditAttribution: carlos8f commentedOops, there were no kittens to begin with. In any case, we need the test bot back.
Comment #89
webchickOops. :P Committed #86 to HEAD!
Comment #90
webchickComment #91
chx CreditAttribution: chx commentedComment #92
David_Rothstein CreditAttribution: David_Rothstein commentedI added documentation for the D7 change at http://drupal.org/update/modules/6/7#drupal_valid_path
Comment #93
jennifer.chang CreditAttribution: jennifer.chang commentedsubscribe
Comment #94
Dave ReidComment #95
Jody LynnI tracked this issue down in cvs from bug report #876580: drupal_valid_path fails for dynamic paths (e.g. user/% cannot be added to menus).
drupal_valid_path is using a $form_item variable that is undefined. When chx changed menu_valid_path to drupal_valid_path the parameters changed more than the innards.
Comment #96
marcingy CreditAttribution: marcingy commentedNot sure if this should stay open or be declared a duplicate - either way it just produces a notice so not critical.
Comment #99
grendzy CreditAttribution: grendzy commented#876580: drupal_valid_path fails for dynamic paths (e.g. user/% cannot be added to menus) has a better description of the problem, so let's set this status back.
Comment #100
xine CreditAttribution: xine commented#76: 190867_path_access.patch queued for re-testing.
Comment #101
hansfn CreditAttribution: hansfn commentedI came here from #236915: Cannot create path alias for 'user/login'. Is there a useable patch in the comments for that issue?
I'm running Drupal 7.19 and can't add an alias for 'user/login'...
Comment #102
klonos...unassigning chx since he doesn't seem to be working on this (last post on this thread was back in 2009).
Comment #103
vflirt CreditAttribution: vflirt commentedHI all ,
I came across this thread as I was trying to add user/login link to a menu. As Drupal is always checking access it kinda fails.
But the reason it actually fails is because this access was already cached before global $menu_admin; so it was always false;
I am not sure if in drupal_valid_path function after the menu_get_item($path) we should add _menu_check_access($item, $item['original_map']); so this way we make sure that we check the access accroding to $menu_admin = TRUE;
I am not sure how to proceed with the dynamic links though.
I would appreciate any thoughts on this.
Kind Regards,
Dobromir
Comment #104
YesCT CreditAttribution: YesCT commentedrelated: #1634916: "My account" used across site although "User account" is shown for Menu link title and Path