[Django] #20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"

19 views
Skip to first unread message

Django

unread,
May 15, 2013, 11:30:18 PM5/15/13
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
--------------------------------+------------------------------
Reporter: pierremarc07@… | Owner: nobody
Type: Uncategorized | Status: new
Component: GIS | Version: 1.5
Severity: Normal | Keywords: gis, admin, srid
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------
broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"

> geodjango_mpoly.get_ewkt = function(feat){return 'SRID=900 913;' +
geodjango_mpoly.wkt_f.write(feat);}

the following change in contrib/gis/templates/gis/admin/openlayers.js
fixed the problem

{{{
- {{ module }}.get_ewkt = function(feat){return 'SRID={{ srid }};' + {{
module }}.wkt_f.write(feat);}
+ {{ module }}.get_ewkt = function(feat){return 'SRID={% localize off %}{{
srid }}{% endlocalize %};' + {{ module }}.wkt_f.write(feat);}
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20415>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 16, 2013, 4:23:47 AM5/16/13
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
----------------------------------+--------------------------------------

Reporter: pierremarc07@… | Owner: nobody
Type: Uncategorized | Status: new
Component: GIS | Version: 1.5
Severity: Normal | Resolution:

Keywords: gis, admin, srid | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by aaugustin):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Even simpler: `{{ srid|unlocalize }}`

--
Ticket URL: <https://code.djangoproject.com/ticket/20415#comment:1>

Django

unread,
May 16, 2013, 7:50:44 AM5/16/13
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
----------------------------------+--------------------------------------
Reporter: pierremarc07@… | Owner: nobody
Type: Uncategorized | Status: closed
Component: GIS | Version: 1.5
Severity: Normal | Resolution: fixed

Keywords: gis, admin, srid | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by Claude Paroz <claude@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"0a29057ebea4335d503e373e4526b1c62c15bcdc"]:
{{{
#!CommitTicketReference repository=""
revision="0a29057ebea4335d503e373e4526b1c62c15bcdc"
Fixed #20415 -- Ensured srid is not localized in openlayers template

Thanks pierremarc07 at gmail.com for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20415#comment:2>

Django

unread,
Jan 27, 2016, 6:30:59 AM1/27/16
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
----------------------------------+--------------------------------------

Reporter: pierremarc07@… | Owner: nobody
Type: Uncategorized | Status: new
Component: GIS | Version: 1.8
Severity: Normal | Resolution:

Keywords: gis, admin, srid | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by olivierdalang):

* status: closed => new
* version: 1.5 => 1.8
* resolution: fixed =>


Comment:

Hi,

I get this bug again (tested in 1.8.5 and 1.8.8).

As soon as I add {{{USE_THOUSAND_SEPARATOR = True}}} in settings.py, the
default map widgets in the admin stop working, as I get this javascript
error :
{{{
`Uncaught SyntaxError: Unexpected token ,` `(index):151`
}}}

The javascript indeed looks like :
{{{
var options = {
...
map_srid: 4,326,
...
};
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20415#comment:3>

Django

unread,
Jan 27, 2016, 9:25:23 AM1/27/16
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
----------------------------------+-------------------------------------
Reporter: pierremarc07@… | Owner: timgraham
Type: Bug | Status: assigned

Component: GIS | Version: 1.8
Severity: Normal | Resolution:
Keywords: gis, admin, srid | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+-------------------------------------
Changes (by timgraham):

* owner: nobody => timgraham
* status: new => assigned
* has_patch: 1 => 0
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/20415#comment:4>

Django

unread,
Jan 27, 2016, 10:03:29 AM1/27/16
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
----------------------------------+-------------------------------------
Reporter: pierremarc07@… | Owner: timgraham
Type: Bug | Status: assigned
Component: GIS | Version: 1.8
Severity: Normal | Resolution:
Keywords: gis, admin, srid | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+-------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1


Comment:

Could you check that [https://github.com/django/django/pull/6052 this
patch] fixes the issue?

--
Ticket URL: <https://code.djangoproject.com/ticket/20415#comment:5>

Django

unread,
Jan 28, 2016, 6:22:53 AM1/28/16
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
----------------------------------+-------------------------------------
Reporter: pierremarc07@… | Owner: timgraham
Type: Bug | Status: assigned
Component: GIS | Version: 1.8
Severity: Normal | Resolution:
Keywords: gis, admin, srid | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+-------------------------------------

Comment (by olivierdalang):

Hi, yes this seems to fix it ! Many thanks !

Question : will the fix be backported to 1.8 ?

--
Ticket URL: <https://code.djangoproject.com/ticket/20415#comment:6>

Django

unread,
Jan 28, 2016, 4:03:57 PM1/28/16
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
-------------------------------------+-------------------------------------

Reporter: pierremarc07@… | Owner: timgraham
Type: Bug | Status: assigned
Component: GIS | Version: 1.8
Severity: Normal | Resolution:
Keywords: gis, admin, srid | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/20415#comment:7>

Django

unread,
Jan 28, 2016, 6:02:09 PM1/28/16
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
-------------------------------------+-------------------------------------
Reporter: pierremarc07@… | Owner: timgraham
Type: Bug | Status: closed
Component: GIS | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: gis, admin, srid | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"19d1cb14519186902d7e27813bf2643fe3f7cfa3" 19d1cb14]:
{{{
#!CommitTicketReference repository=""
revision="19d1cb14519186902d7e27813bf2643fe3f7cfa3"
Fixed #20415 -- Ensured srid isn't localized in OpenLayers JavaScript.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20415#comment:8>

Django

unread,
Jan 28, 2016, 6:07:33 PM1/28/16
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
-------------------------------------+-------------------------------------
Reporter: pierremarc07@… | Owner: timgraham
Type: Bug | Status: closed
Component: GIS | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: gis, admin, srid | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"efd855481581b5758d866a009bbd1074e74869b4" efd8554]:
{{{
#!CommitTicketReference repository=""
revision="efd855481581b5758d866a009bbd1074e74869b4"
[1.9.x] Fixed #20415 -- Ensured srid isn't localized in OpenLayers
JavaScript.

Backport of 19d1cb14519186902d7e27813bf2643fe3f7cfa3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20415#comment:9>

Django

unread,
Jan 28, 2016, 6:07:33 PM1/28/16
to django-...@googlegroups.com
#20415: broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"
-------------------------------------+-------------------------------------
Reporter: pierremarc07@… | Owner: timgraham
Type: Bug | Status: closed
Component: GIS | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: gis, admin, srid | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"229666289d3aafbb4668820a7ecf243dd4a7fc72" 2296662]:
{{{
#!CommitTicketReference repository=""
revision="229666289d3aafbb4668820a7ecf243dd4a7fc72"
[1.8.x] Fixed #20415 -- Ensured srid isn't localized in OpenLayers
JavaScript.

Backport of 19d1cb14519186902d7e27813bf2643fe3f7cfa3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20415#comment:10>

Reply all
Reply to author
Forward
0 new messages