Pathauto is currently using a bunch of strtolower(), strlen(), and other string functions that have drupal_ equivalents. We should probably use the drupal_ version for most (if not all) of these instances. (If someone gets around to it before I do, here's a hint: Use Coder to find the instances. :))
I'm also going mark this as blocking the release of 6.x-1.1.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | pathauto_use_drupal_str_functions.d6.patch | 2.65 KB | Freso |
Comments
Comment #1
Freso commentedIs there a reason these instances were not using the
drupal_functions? (Attached patch has not been tested.)Comment #2
gregglesNo reason that I know. I think I just didn't know about the drupal_*str* set of functions. This seems RTBC to me.
Comment #3
gregglesI gave this some testing and, though I found some other bugs, I don't think this introduces any bugs (my testing and the simpletests still work as expected).
Comment #4
Freso commentedAlright then, committed. :) It should probably be backported though.
Comment #5
Freso commentedThe patch more-or-less applied to 5.x (one failed hunk, some offset), so committed there as well.
I also stumbled upon an empty
for-loop while applying the failed hunk:This should probably be investigated for another (clean-up =)) patch... (It exists in both D5 and D6 versions.)
Comment #6
gregglesI think the empty for loop is just a way to keep trying new aliases until we get one that's unique. It's perhaps an overly fancy/brief construction which is difficult to understand (I didn't write it and I still have to think about what it does to see if it works).
Comment #7
Freso commentedFrom what I can see, nothing is done during the loop - not while calculating the criteria, not while actually running it! If it does anything, it's using time/CPU cycles. But then, perhaps you're seeing something I'm not. ... And then I realised it's making and storing a count in
$i, which is used just a bit later... This is definitely worthy of a code comment. Before we forget what it is. :)Comment #8
Freso commentedAnd since
$iwill always be an integer, we can safely use PHP's ownstrlenon it, for speed. So I'll reverse this bit.Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.