Code

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#700 closed defect (invalid)

urlify.js and slugify use different character for spaces

Reported by: Alastair Tse Owned by: adrian
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: UI/UX:

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.

Attachments (0)

Change History (7)

comment:1 Changed 8 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 8 years ago by hugo

  • priority changed from low to normal

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

comment:3 Changed 8 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 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:5 Changed 8 years ago by eugene@…

  • Component changed from Admin interface to Core framework
  • Resolution fixed deleted
  • Severity changed from minor to major
  • Status changed from closed to reopened

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 8 years ago by adrian

  • Resolution set to invalid
  • Status changed from reopened to closed

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 8 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. :)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.