[wpmu-trac] Re: [WordPress MU Trac] #476: renaming the category
does not change its slug [admin][1.3.1]
WordPress MU Trac
wpmu-trac at lists.automattic.com
Thu Oct 25 19:46:20 GMT 2007
#476: renaming the category does not change its slug [admin][1.3.1]
----------------------------------+-----------------------------------------
Reporter: options | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone:
Component: component1 | Version:
Severity: normal | Resolution:
Keywords: has-patch, 2nd-patch |
----------------------------------+-----------------------------------------
Changes (by options):
* keywords: has-patch => has-patch, 2nd-patch
* type: enhancement => defect
* severity: trivial => normal
* summary: category slug cannot be changed, even if category name has
been renamed => renaming the category does not
change its slug [admin][1.3.1]
Comment:
would love to know, in what way this bug constitutes just a mere
"enhancement" and not a severe ''defect'' indeed?
wank Member October 19th, 2007 at
[http://en.forums.wordpress.com/topic.php?id=16747&page&replies=31#post-127480
6:19 pm]
If you can rename your categories, you need to be able to change the
slug. It is exactly the same principle as changing your post slug when you
change the title of the post.
even Barry of Automattic Inc. has finally admitted this is a true bug:
barry '''Key Master''' October 19th, 2007 at
[http://en.forums.wordpress.com/topic.php?id=16747&page=2&replies=31#post-127481
6:23 pm]
'''Renaming the category should also change the slug'''. If it doesn't,
then '''its a bug''' and something that '''we will fix'''.
and it ''is'' really a long standing bug in all of the "stable" versions
of MU released so far.
this statement in the [source:tags/1.2.5a/wp-admin/admin-db.php at 1125#L104
wp_insert_category()], from the latest non-~~bleeding~~[ticket:475
borking] MU trunk changeset, never updates $category_nicename
{{{
if (empty ($category_nicename))
$category_nicename = sanitize_title($cat_name);
else
$category_nicename = sanitize_title($category_nicename);
}}}
due to "Edit slug:" input field got removed from the wp-admin/edit-
category-form.php, it just ''had to be''
as following:
{{{
if (empty ($category_nicename) || $update)
$category_nicename = sanitize_title($cat_name);
}}}
now, with the latest ''untested'' fauxsonomy stuff merged from WP 2.3
since recently, it has got changed completely, and I'm not sure it won't
get changed even more so in the nearest future.
that's why I've provided a patch, which fixes this bug just by simple
adding 'edit slug' field in the wp-admin/edit-category-form.php, thus not
messing with anything else what is likely going to be changed.
Replying to [comment:1 momo360modena]:
> Agree with you for add edit slug, but WPmu must use the same method as
WP.org.
> [[BR]][[BR]]
> See
> http://trac.wordpress.org/browser/branches/2.3/wp-admin/edit-category-
form.php
in fact my original patch is a verbatim copy and paste of the
aforementioned linked snippet, except for it also urldecodes() it and
therefore makes slugs for being readable.
okay, so I've submitted yet another patch, which doesn't urldecode() slug
and now it's just a byte-for-byte copy of .org's code.
but where exactly else you'd put up `urldecode($category->slug)` in the MU
``proper`` then?
[[BR]]
> For urldecode(), propose a patch in WP trac no ?
certainly, it'll benefit for the international WP community as well.
but the issue is, .org users generally can hack .org source code for that
purpose themselves, whereas all the MU users (like on .com) just
''cannot''. and that's why I'm here.
--
Ticket URL: <http://trac.mu.wordpress.org/ticket/476#comment:2>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser
More information about the wpmu-trac
mailing list