Opened 11 years ago

Closed 8 years ago

Last modified 8 years ago

#20415 closed Bug (fixed)

broken SRID in gis.admin javascript when "USE_THOUSAND_SEPARATOR = True"

Reported by: pierremarc07@… Owned by: Tim Graham
Component: GIS Version: 1.8
Severity: Normal Keywords: gis, admin, srid
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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);}


Change History (10)

comment:1 by Aymeric Augustin, 11 years ago

Even simpler: {{ srid|unlocalize }}

comment:2 by Claude Paroz <claude@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 0a29057ebea4335d503e373e4526b1c62c15bcdc:

Fixed #20415 -- Ensured srid is not localized in openlayers template

Thanks pierremarc07 at gmail.com for the report.

comment:3 by Olivier Dalang, 8 years ago

Resolution: fixed
Status: closednew
Version: 1.51.8

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,
            ...
        };

comment:4 by Tim Graham, 8 years ago

Has patch: unset
Owner: changed from nobody to Tim Graham
Status: newassigned
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

comment:5 by Tim Graham, 8 years ago

Has patch: set

Could you check that this patch fixes the issue?

comment:6 by Olivier Dalang, 8 years ago

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

Question : will the fix be backported to 1.8 ?

comment:7 by Claude Paroz, 8 years ago

Triage Stage: AcceptedReady for checkin

comment:8 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 19d1cb14:

Fixed #20415 -- Ensured srid isn't localized in OpenLayers JavaScript.

comment:9 by Tim Graham <timograham@…>, 8 years ago

In efd8554:

[1.9.x] Fixed #20415 -- Ensured srid isn't localized in OpenLayers JavaScript.

Backport of 19d1cb14519186902d7e27813bf2643fe3f7cfa3 from master

comment:10 by Tim Graham <timograham@…>, 8 years ago

In 2296662:

[1.8.x] Fixed #20415 -- Ensured srid isn't localized in OpenLayers JavaScript.

Backport of 19d1cb14519186902d7e27813bf2643fe3f7cfa3 from master

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