Opened 6 years ago

Closed 6 years ago

Last modified 5 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: David Reynolds 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 David Reynolds 6 years ago.
Initial patch
15024.diff (1.5 KB) - added by Ramiro Morales 6 years ago.

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by David Reynolds

Attachment: format-module-ordering.diff added

Initial patch

comment:1 Changed 6 years ago by Russell Keith-Magee

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: worksforme
Status: newclosed

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 6 years ago by David Reynolds

Resolution: worksforme
Status: closedreopened

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 6 years ago by David Reynolds

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

comment:4 Changed 6 years ago by Russell Keith-Magee

Component: UncategorizedInternationalization
Keywords: blocker regression added
milestone: 1.3
Triage Stage: UnreviewedAccepted

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 6 years ago by Ramiro Morales

Attachment: 15024.diff added

comment:5 Changed 6 years ago by Ramiro Morales

Has patch: set

comment:6 Changed 6 years ago by Ramiro Morales

Resolution: fixed
Status: reopenedclosed

(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 6 years ago by Ramiro Morales

(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 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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