I have a case where occasionally the alias fails to be generated (node title ends up being empty in the token replacement). I would like to act on that event and add some special logic to create my own automatic alias. Attached is a patch that proposes a solution by adding another alter hook as a second chance.
Is there an easier way to do this? If not, would you consider adding this to the module?
Thx!
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 1565850-hook-pathauto-alias-alter-D6.patch | 2.74 KB | dave reid |
| #10 | 1565850-hook-pathauto-alias-alter.patch | 3.07 KB | dave reid |
| #5 | 1565850-hook-pathauto-alias-alter.patch | 1.23 KB | dave reid |
| #2 | pathauto_retry-1565850-2.patch | 1.24 KB | kevin hankens |
| pathauto_retry_alter.patch | 1011 bytes | kevin hankens |
Comments
Comment #1
dave reidI'm not sure about the feasibility of this. What if instead we allowed you to alter $pattern before token replacement is performed ala hook_pathauto_pattern_alter(&$pattern)?
Comment #2
kevin hankens commentedThx for the quick reply! That would be a great fix for me personally. New patch attached for general perusal.
Comment #3
kevin hankens commentedComment #5
dave reidI was thinking something more like this.
Comment #6
kevin hankens commentedThat could work. If I call token_replace() from within that hook I can test to see if the alias will be empty when it is officially generated. It's a bit of an estimation, but that should be ok.
Plus, I really really like the idea of having more control over the patterns themselves!
Comment #7
kevin hankens commentedComment #8
kevin hankens commentedJust checking back on this one. What is the next step to get this patch in? Do you need more eyeballs on it first?
Thx!
Comment #9
dave reidRe-titling and preparing for commit.
Comment #10
dave reidRevised final patch.
Comment #11
dave reidPushed #10 to 7.x-1.x. Marking as needs to be backported to 6.x-2.x. http://drupalcode.org/project/pathauto.git/commit/fb961c0
Comment #12
dave reidPatch against 6.x-2.x.
Comment #13
dave reidCommitted #12 to 6.x-2.x. http://drupalcode.org/project/pathauto.git/commit/9678143
Comment #14
dave reidComment #16
rudiedirkx commentedPlease create a new release. It's been 3 years. It's about time these goodies are actually usable.
Comment #17
rudiedirkx commented7.x.1.x commit: http://cgit.drupalcode.org/pathauto/commit/?id=fb961c08d49d3974d33014f52...