Opened 19 years ago

Closed 19 years ago

Last modified 18 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

Description

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 by Sune Kirkeby <sune.kirkeby@…>, 19 years ago

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

comment:2 by hugo, 19 years ago

priority: lownormal

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

comment:3 by Alastair Tse, 19 years ago

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 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

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

comment:5 by eugene@…, 19 years ago

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 by Adrian Holovaty, 19 years ago

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 by eugene@…, 19 years ago

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