if there is no pattern, don't alter the node form
bennybobw - November 14, 2007 - 22:34
| Project: | Pathauto |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | greggles |
| Status: | closed |
Description
First of all, let me say I love pathauto, and realize that there's a lot of work that goes into it.
I'm currently working on a site where I'd really like to enable pathauto just for one node type, and on the others the user would have to supply one him/herself.
Do you have any plans to add this feature?
Thanks.

#1
I believe this feature is already present. Simply remove the default pattern and enter a pattern only for the node type that you wish to have aliased.
Right now the javascript that disables the box for the "automatic alias" on the node edit page shows up when there is no pattern set for the node type. It should only be present if there is a pattern for that node type.
The assigned field on an issue is for the person who is going to work on something. Do you plan to work on altering this behavior and adding? If so - great I'll look forward to the patch.
#2
Sorry I'm a little confused by your explanation.
That's what I'm talking about. I don't want to have my users uncheck something everytime for a nodetype that I've specified no pattern for. This is especially problematic if I've set up paths for certain nodes that I don't want to re-aliased when pathauto is enabled and the node is edited.
So I'm thinking one of two things either a checkbox at the top that says "Don't use default pattern" so that the administrator has to enter a alias for each node type if that box is checked OR a checkbox per node type that says "Don't use default pattern for this node type if no pattern is present."
I think this would be a fairly easy fix in hook_form_alter, but I don't know if the above is the best solution in terms of usability. Let me know.
I didn't actually assign myself to this issue on purpose. Maybe the new "Issue as comment" thing automatically sets you if you're the author. But in any case, I'd be happy to give the patch a stab.
#3
In your description of the problem you didn't mention that checkbox or the node add/edit screen so I didn't understand that this was about that page. I've changed the title and Category to more directly target the problem since this seems like a bug to me.
I've attached patch which makes sure that pathauto will alias the node (based on a pattern for the node type or a default pattern) before it alters the form. I don't really like the idea of adding yet another checkbox to the form when the value of the checkbox can be derived from other information.
Can you give this a test and let me know if it achieves your goals?
#4
Applied to both the 5.x-2.x and trunk.
#5
Automatically closed -- issue fixed for two weeks with no activity.