Closed (fixed)
Project:
Pathauto
Version:
5.x-2.0-beta5
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
13 Feb 2007 at 16:20 UTC
Updated:
16 Nov 2007 at 12:42 UTC
Jump to comment: Most recent file
I'm using the latest dev version (feb 12 2007) from pathauto with Drupal 5.0, but this bug occured in previous versions as well.
The problem is that pathauto creates two aliases for some nodes. I get /articles/category and /articles/category-0 for example. The one points to pathauto/node/articles/category while the other points to /taxonomy/term/27. The latter address doesn't work but still is created. I cannot see any patterns and it happens with some nodes ans terms from the one vocab and with some of another, so it's limited to a nodetype or a vocab.
| Comment | File | Size | Author |
|---|---|---|---|
| #57 | forum_separation_118676.patch | 5.72 KB | greggles |
| #55 | pathauto_taxonomy.inc_.patch | 722 bytes | denney |
| #47 | forum_and_catpath_0.patch | 9.94 KB | greggles |
| #35 | forum_and_catpath.patch | 9.94 KB | wim leers |
| #19 | forum_taxonomy_pathauto.patch | 8.11 KB | wim leers |
Comments
Comment #1
gregglesXano - this is an interesting bug.
You mentioned that it's intermittent so until it's more consistently reproducible we'll need to leave it "active (needs more info)".
Comment #2
xanoWould it be helpful to post a complete list of aliases, pathauto settings and the content I have?
Comment #3
xanoKick
Comment #4
gregglesSure, provide what you can.
The point is: until there is a repeatable set of steps that can lead us to cause the problem we can't even begin to solve it. So, whatever you can provide that will lead other people to be able to repeat this consistently then that's great.
Comment #5
TBarregren commentedI have the same problem, and I can always reproduce it. This is what I do:
[vocab]/[catpath]When I view the alias table I notice that for each
[vocab]/[catpath]pointing toforums/[tid], I also get a[vocab]/[catpath]-0pointing totaxonomy/term/[tid].Comment #6
gregglesexcept that's not the same problem (pathauto creates multiple aliases for one node) it's a similar but different problem (pathauto creates multiple aliases for one taxonomy).
TBarregren - can you create a new issue for your problem? I have a feeling it's related to forums. Also, when you create the new issue please test (and report on) whether the problem exists for all taxonomy terms or just for forum taxonomies.
Thanks.
Comment #7
xanoI just tried another few things to confirm what I was expecting. Pathauto indeed creates multiple term aliases, just like TBarregren said. My apologies for putting everybody on the wrong track.
How do you reproduce it:
Create a few subforums and in some of them a topic. Now empty the table url_alias and let Pathauto generate every alias from scratch. Go to the forum and hover the links to the subforums. You'll see they have "-0" put after the URL they should have. This same problem occurs with terms for other content types as well.
I guess the problem is that Pathauto thinks "/forum/subforum" and "/forum/subforum/topic" are somehow the same and adds "-0" to the former URL. Hope I provided enough information for the developers to fix this.
Comment #8
gregglesXano - this is still "needs more info".
I need concrete baby steps for what you did. Sentences like "let Pathauto generate every alias from scratch" doesn't tell me whether you used bulk update for categories or nodes or both. Or whether you just edited all the content. Within those ways are about 6 different possible paths to "let pathauto generate the aliases" and I don't want to play a guessing game.
Please share the exact steps and the list of patterns that you are using.
As you are creating the detailed set of steps, please "reduce" the problem to the smallest number of taxonomy terms (and nodes if necessary) that are necessary to reproduce the problem. That will make it easy for someone to reproduce and solve.
Comment #9
xano- Create a vocabulary with two terms.
- Add a node to one of the terms.
- Set Pathauto to use "[vocab]/[cat]/[title]" for the nodes and "[vocab]/[cat]" for the categories.
Now empty the table url_alias and use bulk update for nodes and categories to generate those aliases from scratch.
You'll notice the term without the content will have an url like "/vocab/term", while the other (with the content) will have one like "/vocab/term-0".
Will this suffice?
Comment #10
gregglesWell, yeah that's pretty clear to me. Now I just have to try to repeat it, but hopefully that won't be a problem.
Comment #11
xanoI was wondering If you had already worked out something. Sunday I'll go away for vacation and if you need anything I can provide it before then.
Comment #12
xanoKick. Is anyone still working on this?
Comment #13
gregglesxano - I work on fixing bugs when I feel like it. That usually comes in spurts about once a month. In between those spurts I spend time trying to understand the bug so that when a spurt comes along I can be productive in finding/fixing the bug (and if you look at my comments you can see that I've spent over an hour reading/writing about this bug - an hour of my free time that I gave to this bug).
If you want to help on this issue there are many things you can do to debug this yourself (if you are unfamiliar with debugging there are many great resources online to learn how to do it). Or you could help by "triaging" the other bugs in the pathauto issue queue. Now that you simplified your case down to a simple test case you are familiar with the process and level of detail that we need to get on other bugs and you could help other people get to this level.
Comment #14
xanoI understand the way you work (I work in exactly the same way) and I didn't mean to offend you or sound aggressive. I was just curious, partly because I need the module for a Drupal site to replace a temporary Joomla version. I would very much like to fix that bug myself but I'm so terribly busy at the moment that every moment of free time goes to that website (which is to help other webdesigners/developers) and to help others directly. I know this might sound pretty dumb while my posts suggest I'm pushing you to fix the bug, but it's true. And I actually didn't know you were the only one working on pathauto. Thumbs up for the work you've done so far ;-)
Comment #15
suzanne.aldrich commentedHi there, I'm having this problem but only (so far) with my category for forums. I'm using Drupal 5.1 and Pathauto 5.x-2.x-dev versions. I have one custom content type called "Column entry". I have my categories setup like so:
Starting with a clean url_alias table, I configure pathauto thusly:
What I end up with in my url_alias table is this:
The difference between forum/n and taxonomy/term/n isn't very easy to distinguish, and I'm also not sure about the forum/n/0/feed links vs. the taxonomy/term/n/0/feed links. Can someone explain this to me?
Hopefully this is just happening with the forum category. I am going to be adding test content to my site soon, and will report if it happens to the other categories.
Comment #16
greggles@aigenta - thanks for the very complete feedback. First, please don't use the 5.x-2 branch unless you want to help in testing. That is an unstable branch where I will almost certainly break things a few times before it becomes stable. Use at your own risk! (though I appreciate testers ;) ...)
I believe that this issue is really a feature request - that pathauto should have special handling for forum listing pages (e.g. forum/tid). Right now it treats forums as just another vocabulary and hence aliases it the same (which leads to duplicates which leads to getting a number on the end).
If someone works on a solution for the 5.1 branch (which wouldn't be hard) then I'd be glad to review and commit it. Otherwise I will try to fix this as part of the work that I am doing in moving pathauto to use token module ( http://drupal.org/node/129482 )
Comment #17
gregglesOne more thing:
Workaround: - make sure that the taxonomy pattern for your forum vocabulary is blank (and the default is blank) so that the forum taxonomy term does not get aliased. This will prevent them being the same alias which prevents them from getting the index appended.
Comment #18
gregglesHere is the solution, in case anyone wants to work on it:
Check to see if forum module is installed. If so, provide a group of settings for that module that allow a set of patterns specific to forums. Make sure that the default pattern will not collide with defaults for other patterns.
Then, it's just a matter of making sure that pattern is used in pathauto_taxonomy.inc when creating aliases.
For an example of code to copy look to the code in pathauto_user.inc for blogs and/or tracker.
Finally, this is a feature, not a bug, so it should be done on the 5.x-2 branch. I'm about to make a big commit on that branch related to using tokens so anyone working on this should wait for that to land to get into the pattern part of it, though the rest can be done now.d
Comment #19
wim leersI've written a patch (for 5.x-1.1) that solves this issue. Thanks to greggles for telling me what I should do to work-around this problem permanently! Tested on my site, it is all working perfectly now :) While I was busy, I also made some very minor changes to other code to comply with Drupal's coding standards, and I've refactored a piece of code that generates the [catpath] placeholder, since it's now being used by two functions.
So what exactly has changed in practice? You now get a separate configureation fieldset for "forum paths", i.e. for url aliases for forums and forum containers.
My set-up:
1) make sure the forum taxonomy is set as the vocabulary with the lowest weight for forum topics (if you're using multiple vocabularies for forum topics)
2) make sure pathauto is setup like this:
-forum (the forums and forum containers) paths:
[vocab]/[catpath]-forum topic (the nodes) paths:
[vocab]/[catpath]/topic/[nid]-forum taxonomy (the "forum" vocabulary) paths:
forumtaxonomy/[catpath]Now all topics are properly named like this:
forum/other/site-feedback/topic/394. (My "Forum" vocabulary is namedforum.)Note that this patch only solves the problem for forums!
Comment #20
gregglesNobody affected by this wants to test Wim's work?
I'm not affected by it, so it's harder for me to test.
Comment #21
xanoI'm terribly sorry. I won't try this on my only live Drupal site and I'm too busy with school to work on something locally. The first time I'll be able to do anything big considering webdesign will be in a month due to my final exams.
Good job on the patch though, Wim!
Comment #22
abramo commented@xano : repeatedly telling us that he is very busy so he cannot contribute any of his time, still wants everybody else to be busy (and fast) to resolve an issue that concerns him - not nice at all . . . .
Comment #23
wim leersI assume having tested this on 2 different sites isn't sufficient to mark it as RTBC?
Oh well... then we'll have to wait another month I guess...
Comment #24
gregglesfolks, folks - no need to point fingers and criticize each other.
@abramo - you too could test and review the patch. I look forward to seeing that review.
@wimLeers - even drupal's core committers get a review from a second person prior to committing something.
Comment #25
abramo commentedthis thread seemingly started out as a general pauthauto issue, and then developed into a forum/pathauto issue. I do not run a forum on my sites and/or local test site, so I have no possibility of helping out in this respect.
however I follow the discussion here as this is actually seems to be a general pathauto issue : meaning, ex., in an environment using categories module and cck module (such as mine), duplicate url aliases are created, whereby only a single one is functional (as also stated in the first post of this thread). the patch provided here is relevant only to sites using the forum module - but the issue is not only relevant to an environment that includes a forum.
Comment #26
gregglesOk.
Abramo - can you submit a new issue to track your specific problem (and please provide a set of steps to repeat your problem).
There are several problems here, one of which is the forum problem. I'd like to have this issue focus only on the forum related issue (and have changed the title to reflect that).
Comment #27
abramo commented@greggles : many thanks for your attention : shall create detailed new issue as requested.
Comment #28
maiki commentedFirst of all, thank you. I appreciate the effort from greggles and Wim Leers. I applied the patch on my sandbox. I hope this comes out as cohesive.
So, it is working, and I am about to put it on a live site. My question, which is curiosity, is this: Is the category setting for forum paths needed with this patch? I am of the notion of not configuring what I don't have to. No need to explain it if it is too much effort, it is not nagging me or anything, I am just trying to understand this module more (which is one of my favorites).
I am not sure if my testing qualifies as a second, but nothing is burning. ^_^
Again, thanks for the effort.
Comment #29
wim leersBasically you're asking what the difference is between "forum" and "forum taxonomy" (quoted from my folluw-up #19)?
I hope this makes sense... if you don't understand it, just browse to one of the "forum taxonomy" pages. What you can see there is what would have been displayed if the forum module didn't add their "additional layer".
And... you've pointed to a valid point there. Thanks to this patch, you no longer have to set the "forum taxonomy" (as in my example), or "the category setting for forum paths" as you describe it! Why didn't I think of that? :|
P.S.: that "output above the page" are simple Drupal messages, they're not some hack or anything like that ;)
Marked as RTBC now. I think your testing qualifies as a second :) Thanks for testing!
Comment #30
wim leersWe need another review before this can be marked as RTBC.
Comment #31
terrybritton commentedWim, I loaded up the patch and everything works fine, except the information above the screen. Your last post said that was not a hack, I'm not clear on what you're saying since pauthauto didn't do that before.
Hope this helps.
Comment #32
terrybritton commentedI really wish you could edit your own posts. I just added a new forum and the path was not created for the forum until I went into pathauto and did a bulk update on forum path settings.
Comment #33
wim leersNice find, Terry! I reproduced this bug. I'll try to come up with an updated patch.
Comment #34
wim leersI thought I had it fixed, but then it turned out to be not doing anything at all... Because of forum.module's custom administration pages. I'll have to find some work-around, but that'll be for tomorrow.
Comment #35
wim leersterrybritton, the issue you found is now fixed. While working on that fix, I saw that the [catpath] placeholder wasn't working properly. I've found a work-around and have included it in this same patch, because it's just one line of code. Since that was a critical bug, this issue is now marked as such.
Comment #36
maiki commentedA quick question on patching, do I patch the original module with this new one? Want would be the best way to make sure I am testing the changes?
Comment #37
greggles@WimLeers - thanks for your continued efforts on this.
@maiki - yes, patch the version in the "Version: " dropdown on the issue (in this case 5.x-1.1).
Comment #38
suzanne.aldrich commentedYay! This totally solved my
_0problem as I described earlier in the thread. Thank you very much!Comment #39
wim leers@aigeanta: could you please confirm that the newest patch does not have the problem described in follow-up #31 & #32?
Comment #40
terrybritton commentedWim, after adding the latest patch I still have the same problem. When adding a container and forum the forum taxonomy path is generated, but the forum path is not created until I do a bulk update.
Comment #41
terrybritton commentedWim, I'm still having the same problem. When I add a container and forum the taxonomy forum path is created, but the forum path is not created until I do a bulk update.
I also still have my question about why I get all the info above the page when doing a bulk update, which did not happen before applying the patch.
Comment #42
wim leersStrange. It works perfectly for me now.
1) "all that info when you do a bulk update" should have been there before too, that part of the patch has not been touched at all.
2) If it's still not working for you, I have no clue, since it works fine for me now. Somebody else will have to either confirm that you're right or wrong.
Comment #43
suzanne.aldrich commentedI didn't add any new containers, just a new forum, and it seemed to create the path fine.
Comment #44
wim leersgreggles, did you ever get to testing this?
Comment #45
terrybritton commentedHey Wim, sorry about the delay in getting back to you, I was off on a fly-in fishing trip in Canada. I'm not sure what I was doing before, so I reloaded pathauto, installed your patch and everything works fine. Hope this is enough to get it incorporated. Now if I can just get og_forum to work with pathauto.
Comment #46
wim leersThanks Terry!
Comment #47
greggles@wim - your patch doesn't apply. 2 hunks fail. How can that be RTBC?
I've rerolled it so that it should apply.
Also, "works for me" is not a review. A review is a review. Please, people, review the code under a variety of situations.
Comment #48
wim leersSorry about the not-so-applying patch. I simply haven't checked it again.
Two reviews of "it's working" is better than nothing and at least proves the code is working. And it's not working at all right now, so I don't see why this patch should not be committed (except for the not applying part of course).
Granted, reviews are good, they guarantee code quality. But if *they* say it works and you take a look at the code and it looks good and it's clear (or properly commented) what it does, then why keep postponing a commit? It's not like it touches hundreds of lines.
I can understand your point of view and respect it. But I've had it with this patch. I hope you understand me.
Thanks for the reroll btw.
Comment #49
gregglesOk, I committed it. I don't use 5.x-1 any more, so if it causes problems it's problems for someone else ;)
Thanks for all your help, I do appreciate it.
I also suggest that if people haven't then they do read the "how to review a patch". Testing and reviewing a patch is not just installing it and getting 1 test case to work. If I only tested one test case we'd have an even buggier module. Which is certainly a scary thing.
Comment #50
suzanne.aldrich commentedSorry for the review-that-wasn't, I will do better next time. I was just very excited that it worked and fixed a nasty problem and wanted it to be committed rather than me continuing to hand edit paths or keep it patched up myself. I would rather it got committed and introduced some subtle bugs that would have to be addressed in new issues than keeping it around as a patch forever because fewer people are likely to test it, just the ones following that particular bug. But everyone has different development styles, and it's not my project, so I should just be quiet :-)
Comment #51
(not verified) commentedComment #52
suzanne.aldrich commentedThis issue has popped up again in the latest 5.x-2.x-dev version, so I am setting it to active again. The patch fix was only provided for the 5.x-1.1 version and never propagated into the new tokens branch. I am willing to test any new patches with my drupal 5 dev mysql install and provide my configuration info. This bug shall be vanquished!
Comment #53
gregglesThat's the proper status. We no longer need a solution to the catpath problem (it wasn't a perfect solution anyway).
And for the record, I don't plan to work on this now.
Comment #54
denney commentedI'm getting this issue with the new version also.
There is a bigger problem now. When I EDIT a forum that doesn't have a alias on the forum admin screen and then save it, the -0 path is created. I then cannot edit the forum again as it just returns me back to the original screen!!
The path before aliasing: /admin/content/forum/edit/forum/119
The path after aliasing: /admin/content/forum/edit/category/forums/projects/msnet-0
The path after aliasing doesn't work so I cannot edit my forums unless I delete all aliases, edit my forums and then re-create the aliases (not feasible in reality!).
Comment #55
denney commentedWell, that was a hell of a lot easier to fix than I thought... The attached patch appears to fix the issue by preventing Pathauto from creating a taxonomy term alias if an alias for the forum was created.
Comment #56
denney commentedThe above patch won't work with Bulk Updates. If you delete all your aliases and then bulk update the category path aliases, forum aliases WON'T be created.
I find that I have to delete all category aliases, go into the forum administration and edit then submit each of my forums (this creates the forum aliases) and then I can go and bulk update my category path aliases with Pathauto.
Comment #57
greggles@denney - your patch is quite different from what we implemented in 5.x-1. As long as we do this for compatibility we should do it similarly, right?
I've rebuilt the patch that Wim and I created in #47 for the 5.x-2.x branch.
Please test and let me know if it achieves what you need.
Comment #58
gregglesComment #59
denney commentedYour right. We should keep them in the same vein. My patch was more of a "quick fix" I guess.
Your updated patch appears to work fine. I was able to delete all my current aliases and re-create them.
Comment #60
gregglesGreat - thanks for testing, Denney. I do appreciate you making that patch. In general, it would be helpful if you said "this isn't a perfect solution it's just a quick fix" or something like that so people know what they are dealing with.
Anyone else care to test? Or do I just apply and pray ;)
To be clear:
1) This patch prevents creating an alias for taxonomy/term/TID if that TID is the forum navigation vocab.
2) It creates a separate section of settings in admin/settings/pathauto which has options and guidance specifically for the Forum module which creates aliases for the forum/tid path
3) It supports both regular creation and bulk generation
If you don't review the code please at least review those ideas.
Comment #61
gregglesThis has now been applied.
Comment #62
suzanne.aldrich commentedHi there, sorry I'm late to the party. Here's my review of this fix, which is an answer to a bug I was experiencing in previous versions of pathauto so I have a little knowledge of the situation.
Yes, it does that. It also prevents creating an alias for taxonomy/term/TID/0/feed, which is the proper feed to alias to, so the RSS link at the bottom of each forum does not have a nice pretty pathauto-generated url alias. The url alias being generated, to forum/TID/0/feed, just gets you to the forum page on forum/TID and so it doesn't really do the right thing; it's not RSS output that feed readers could subscribe to, and is basically worthless.
The separate section was nice to have, and it made sense in its placement on the settings form. Thanks for the UI improvement.
...And I only tested the bulk generation, which worked great.
So my overall review of this patch is that it works as advertised with the exception of the path for the forum feed, which needs to be rethought and fixed up.
Comment #63
greggles@aigeanta - thanks for your detailed review and for finding that issue. It was also in the original patch for 5.x-1.x I believe.
I've created a new issue for the problem you found here: http://drupal.org/node/188762 Let's move the discussion there.
Comment #64
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.