Closed (fixed)
Project:
Path
Component:
Miscellaneous
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Oct 2006 at 13:13 UTC
Updated:
7 Mar 2008 at 00:21 UTC
Jump to comment: Most recent
I have a teaser type, and all the other variables are working for anonymous users, but not the $path. I've been able to get around it by using $nid in this case, but has anyone else seen this?
Comments
Comment #1
colm_iqc commentedFix for this would be really appreciated.
Comment #2
colm_iqc commentedIt seems to be something to do with the administrating the urls:
Turning on the following option for all users makes it work.
path module - administer url aliases
Comment #3
markhope commentedYes a fix for this would be extremely welcome. Allowing anonymous users to administer paths does fix it - but I'm not mad enough to apply that on a live site!
I hadn't noticed this problem as I'm nearly always logged in. damn.
Comment #4
jeffabailey commentedI have the same problem, a fix would definitely be appreciated.
Comment #5
visualnotion commentedYes, a fix would be great. Does anyone know if you can get around this by using CCK template files and bypassing Content Template?
Comment #6
czheng commentedditto above. would love to see a fix for this.
Comment #7
ncameron commentedHey there,
This is not a fix but a nifty work around until it can be patched up. Slip this snippet of code at the top of your .tpl.php file and if the $path variable is unset then it will replace it look up the url alias and set $path as that.
Hope this helps. Any thoughts, feedback appreciated.
Thanks,
Neil
-----------------
Connecting Language Learners
www.huitalk.com
Comment #8
technivant commentedThanks! It dind't work for me in my .tpl.php so I stuck this in my content type template (a la contemplate) and changed $node->nid to $nid and it works perfectly.
Comment #9
jaysmall commentedI couldn't get either of the two snippet methods suggested above (e.g., in template file or Contemplate custom teasers) to work in my teaser blocks in a 5.0 installation. But the following, in my Contemplate custom teasers, does work. Does anyone see a problem with this implementation?
<a href="<?php print drupal_get_path_alias('node/'.$node->nid); ?>">...</a>Thanks.
Comment #10
maastrix commentedI had the same problem. Put your line of code in my node-type.tpl.php and now it works like a charm. Thanks.. Seems okay.
Comment #11
Brian.Harris commentedAlso if you use pathauto you can use
Comment #12
ludek.safar commentedYep, tried with success, problem seems fixed. Thanks a lot!
Comment #13
marcoBauli commentedtip at #7 above works great in views templates generated by Views Theme Wizard :) Thanks!
Comment #14
wilco commentedI came across this issue recently when playing with Clean URLs and URL Aliasing with Views in Drupal 5.1. An anonymous user browsing the site would get all explicit URL Aliases but all the paths created dynamically from the View Module were not showing up.
I did some snooping around and found a solution suggesting modifying the node.tpl.php to add a few lines of code. In doing some thinking I came up with a solution that worked more thoroughly. I found, as in my case, having to modify and keep updated a large set of node.tpl files to cumbersome. Here is my template.php solution:
Comment #15
sgriffin commentedAwesome thread, just got bit by this with cck to sum up.
use url("node/$nid") not $node->path
Not sure even why $node->path is listed.
Comment #16
Tom-182 commentedI've tried the solution on #14, adding the codes to template.php didn't work on my Drupal 5.1 site.
Comment #17
Tom-182 commentedI finally use the solution in http://drupal.org/node/146477 and it works like a charm.
Just use
print drupal_get_path_alias("node/$node->nid");to load the path in Contemplate.Comment #18
texas-bronius commentedurl("node/$nid"),drupal_get_path_alias('node/'.$node->nid)and other derivatives suggested herein work well, but not with the Contact Module (and I expect some other modules..?) On my contact pages path-aliased like "meetings/contact", "banquets/contact", the suggested workarounds returnnode/. Node types, however, work like a charm.I think the fix should be to simply append path to $node regardless of whether a user has path admin privs or not. A bigger fix might be to rely not on Path module's modification of $node but something lower level and hanging off $variables, to be used independently of Path.
Comment #19
ceejayoz commentedI'm baffled that this is apparently a long-standing issue. Having the site be entirely unusable by anonymous users would seem to be a fairly significant problem...
I just commented out the check in
path_nodeapi()for user permissions (first line of the function) - it's a better option than enabling anonymous users to administer paths, unless I'm missing something major.Comment #20
nosro commentedAgreed with #18 - I ran into this problem when using the Services module, and I can't use the suggested workarounds to get the path to be included in my service. My only options seem to be to modify the Services or Path modules.
Comment #21
summit commentedHi,
Subscribing. Anonymous users should not be handled differently regarding clean-url's in my perspective.
greetings,
Martijn
Comment #22
Anonymous (not verified) commentedOK... after having looked through this whole issue... I found that the problem actually lay within the path.module file of the path module. I have version 5.5 of drupal and the problems were the same for me. No need for these contemplate workarounds or .tpl.php
fixes.... edit the path.module file found in drupal's "../module/path" folder like so:
goto line 214 or do a search for " ('administer url aliases') " in your text editor.
you should come upon this...
CHANGE IT TO THIS:
Works in both IE and Firefox... hope this is the real fix!
HAPPY NEW YEAR
Comment #23
Anonymous (not verified) commentedPS... if you happen to see
<b> || $op </b>this is because the server has not yet refreshed its cache.normally it should just say ...aliases') || $op) {
Comment #24
summit commentedHi,
I think this should be put in a patch so with an update the changes are not gone, right?
greetings,
Martijn
Comment #25
tj2653 commentedI just stumbled across this issue when I realized two of my links with $node->path wasn't working for anon/regular users. The patch in #22 seems to fix it for me. Thanks rudeboyal!
Comment #26
robloachhttp://drupal.org/node/216404
Comment #27
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.