This fixes a notice, but I also feel like this must be causing major bugs. Unfortunately I can't find what bug this could be causing because most taxonomy editing seems to be working the right way for me...

Comments

greggles’s picture

StatusFileSize
new783 bytes

without the debug...

Freso’s picture

Did you run Pathauto plus this patch through the simpletests?

smoothify’s picture

StatusFileSize
new454 bytes

I ran into a problem with this code in the Drupal 5 version and was about to post a similar patch but didn't know how to phrase it.

The issue was that using weblinks module would cause some broken taxonomy aliases.

weblinks uses hook_term_path() to set a custom path for the term - e.g weblinks/tid and attempts to override the term page.

However when using pathauto, the pathauto code covered in the patch should pass an object to the taxonomy_term_path function not the term id.

function taxonomy_term_path($term) {
  $vocabulary = taxonomy_get_vocabulary($term->vid);
  if ($vocabulary->module != 'taxonomy' && $path = module_invoke($vocabulary->module, 'term_path', $term)) {
    return $path;
  }
  return 'taxonomy/term/'. $term->tid;
}

In my case it wouldn't find the vocabulary which meant that the hook didn't fire, and then it also returned a broken path - taxonomy/term/

The patch above should fix the issue for 6.x and i've attached one for 5.x

nicholasthompson’s picture

Status: Needs review » Reviewed & tested by the community

Fix is confirmed as working for Drupal 5. Looks like the same fix applies to D6 too.

nicholasthompson’s picture

Title: notice and what seems to be a bug? » taxonomy_term_path being passed TID instead of Term Object

Renaming to a sensible title.

greggles’s picture

Status: Reviewed & tested by the community » Fixed

I ran the simpletests, they worked fine, so I committed this to

5.x-2 http://drupal.org/cvs?commit=136700
6.x-1 http://drupal.org/cvs?commit=136702
6.x-2 http://drupal.org/cvs?commit=136701

Thanks for the review, nicholasThompson.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

jbomb’s picture

any thoughts on the next stable release of pathauto which might include this fix?

greggles’s picture

I want to fix at least http://drupal.org/node/180440 first.

I will be doing a new release of token shortly as well.

mrkistic’s picture

This can't be pushed out to a production release although it's been around for 11 months?? I've been cursing for a couple of hours now, trying to work out what in the hell was going on with my code. Turns out it wasn't mine after all and I finally traced it to this bug. Which was already fixed but just not made available :(

rootwork’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Active

Is there an update on this? Item 180440 that you want to fix has its comments closed, and the ChipIn campaign has ended (so no one can contribute anything).

#180440 does seem like it would be a nice thing to have...but the present "stable" version of pathauto crashes and burns for anyone using taxonomy terms -- which is the great majority of people. This is your module, of course, but is waiting to fix one bug that doesn't seem to be getting worked on worth holding up a full release for a critical bug that renders the module unusable for many people? The decision is yours, of course, but a year does seem quite a bit of time to wait for a fixed critical bug to get rolled out.

dave reid’s picture

Priority: Critical » Normal
Status: Active » Fixed

#369840: If a user changes the automatic path, try to remember that in the future is the continuation of issue 180440. It has a patch ready for review but no one is actually testing and reviewing it.

Resetting issue status (to fixed) and priority.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

sdrycroft’s picture

Just thought I'd chime in and agree with some of the previous posters. I've just spent far too long trying to debug an issue that could have been fixed by removing four characters from a file. Please release this ASAP for the benefit of everyone else using this module.

Tally’s picture

@smoothify in #3, the patch identified in this thread, which was included in the 6.x-1.2 release, still has problems with WebLinks. See http://drupal.org/node/590554 to see how I worked around it.

heyyo’s picture

Version: 7.x-1.x-dev » 6.x-1.3

I still have this bug on 6.x-1.3, evrytime I change name of terms, i get taxonomy/term/id becomes aliased to taxonomy/term

In path auto settings I have:

Update action:
Do nothing. Leave the old alias intact.
Create a new alias. Leave the existing alias functioning.
Create a new alias. Delete the old alias.
X Create a new alias. Redirect from old alias.

Pattern for all language neutral Tags paths:
[i18n-vocab-raw]/[i18n-cat-raw]

I'm also using Path redirect 6.x-1.x-dev (2010-Mar-19) and Internationalization 6.x-1.4

Help is really welcome

heyyo’s picture

Status: Closed (fixed) » Active
greggles’s picture

Status: Active » Closed (fixed)

heyyo, your issue is likely related to using i18n-vocab/i18n-cat. I suggest opening a new issue for the module that provides those tokens.

heyyo’s picture

Gill Xu’s picture

+1