Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#700 closed defect (invalid)

urlify.js and slugify use different character for spaces

Reported by: Alastair Tse Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: major Keywords:
Cc: alastair@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


When a model has a SlugField and prepopulate is turned on, the javascript from urlify.js in the admin interface will use underscores to replace spaces and the defafult template filter slugify will use hyphens. I suggest that the slugify in the template filters use underscores to be consistent with what happens with the admin interface.

Change History (7)

comment:1 Changed 14 years ago by Sune Kirkeby <sune.kirkeby@…>

Please, don't use underscores. They are not google-friendly. Instead fix the javascript to use hyphens.

comment:2 Changed 14 years ago by hugo

priority: lownormal

Most definitely use hyphens. Especially since that's what #317 already changed (just urlify.js wasn't changed).

comment:3 Changed 14 years ago by Alastair Tse

No problems with that, then its only a one character fix in urlify.js :) I didn't know that underscores were google-unfriendly though.

comment:4 Changed 14 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [1017]) Fixed #700 -- urlify.js now uses hyphens instead of underscores

comment:5 Changed 14 years ago by eugene@…

Component: Admin interfaceCore framework
Resolution: fixed
Severity: minormajor
Status: closedreopened

This patch breaks Django with MySQL backend (maybe other backends are affected as well). I am getting 404 for all new slugs. I checked databases and everything looks o.k. I suspect that it is related to unquoted slugs (see #121) --- before slugs were words, now they are arithmetic expressions. :)

comment:6 Changed 14 years ago by Adrian Holovaty

Resolution: invalid
Status: reopenedclosed

If you're getting 404s, you'll probably want to alter your URLconfs so that they catch hyphens instead of just "\w" (alphanumerics + underscores).

comment:7 Changed 14 years ago by eugene@…

Error code: 404, response time: 5 minutes, code change: 3 characters, results: priceless. There is one thing money can't buy --- true personal experience. :)

Note: See TracTickets for help on using tickets.
Back to Top