Auto alias fails with some content types

izmeez - October 26, 2009 - 14:47
Project:Pathauto
Version:6.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

I have reverted to using pathauto 6.x-1.dev (2009 Oct 08) to solve this problem.

In 6.x-1.2 and the current version the auto alias is not active when new content is created. This does not occur with all content types. In many the auto alias is active. However, with Support module tickets it was not the case.

Testing different versions of the Support module makes no difference. However, reverting to the earlier pathauto dev solves the problem.

This problem is significant because new tickets and possibly other content created will require url alias to be updated.

Thanks,

Izzy

#1

brad bulger - October 26, 2009 - 22:05

it looks to me that this is caused by the way it tests to see if this is a new node:

if (isset($node->nid)) {

this will test as TRUE if $node->nid is 0 (only NULL fails isset()). changing it to

if (!empty($node->nid)) {

makes the checkbox come up checked when creating a node.

zero vs NULL in nid may be something about the content type - in my case, it's a CCK content type that comes from a feature, that may be an issue.

AttachmentSize
pathauto.isset_.patch 597 bytes

#2

izmeez - October 29, 2009 - 18:34
Status:active» needs review

Brad,

Thanks. The patch works. I have changed status to needs review. Hope that's the right thing to do.

Izzy

 
 

Drupal is a registered trademark of Dries Buytaert.