Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#15024 closed (fixed)

The order of the list returned by django.utils.formats.get_format_modules changes since version 1.2.4

Reported by: DavidReynolds Owned by: nobody
Component: Internationalization Version: 1.2
Severity: Keywords: blocker, regression
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

This manifests itself in the admin javascript date picker. The format for the date inserted by the 'Today' link changes every time I refresh the page.

If you look at the /admin/jsi18n/ URL and refresh it a few times you can see the formats varying on each refresh.

I have a fix, but I'm not sure if it is the best way to fix it (see attached patch)

VERSION: 1.2.4

Attachments (2)

format-module-ordering.diff (417 bytes) - added by DavidReynolds 5 years ago.
Initial patch
15024.diff (1.5 KB) - added by ramiro 5 years ago.

Download all attachments as: .zip

Change History (10)

Changed 5 years ago by DavidReynolds

Initial patch

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

I can't reproduce this, and I can't think of any obvious reason why formats would be in unpredictable order; to the best of my knowledge, they're always stored and retrieved in list/tuple order.

If you can provide more complete reproduction instructions (possibly a project that duplicates the problem), please reopen.

comment:2 Changed 5 years ago by DavidReynolds

  • Resolution worksforme deleted
  • Status changed from closed to reopened

I can recreate it with a new project in a clean virtualenv. I think the key to what makes it change is setting the LANGUAGE_CODE to 'en-gb' - could you try that on your setup and see if you can recreate it?

comment:3 Changed 5 years ago by DavidReynolds

My guess would be the ordering of django.conf.locale.en_GB and django.conf.locale.en is changing

comment:4 Changed 5 years ago by russellm

  • Component changed from Uncategorized to Internationalization
  • Keywords blocker regression added
  • milestone set to 1.3
  • Triage Stage changed from Unreviewed to Accepted

Ok - confirmed with en_GB (i18n and l10n enabled); I couldn't reproduce with de_DE. It's also a regression from 1.2.3, making this a release blocker.

Still no idea why it would be happening, though...

Changed 5 years ago by ramiro

comment:5 Changed 5 years ago by ramiro

  • Has patch set

comment:6 Changed 5 years ago by ramiro

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

(In [15183]) Fixed #15024 -- Ensure that choice of L10N format module used is stable given a stable setup of format modules in ll/ and ll_CC/ dirs. Thanks David Reynolds for the report and suggestions leading to the solution.

comment:7 Changed 5 years ago by ramiro

(In [15184]) [1.2.X] Fixed #15024 -- Ensure that choice of L10N format module used is stable given a stable setup of format modules in ll/ and ll_CC/ dirs. Thanks David Reynolds for the report and suggestions leading to the solution.

Backport of [15183] from trunk.

comment:8 Changed 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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