Changeset 555


Ignore:
Timestamp:
Nov 17, 2004, 5:28:12 PM (17 years ago)
Author:
kake
Message:

Fixed bug relating to lat/long representation in dms.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Changes

    r554 r555  
     1        Fixed bug relating to lat/long representation.
     2
    130.44    17 November 2004
    24        Remove all traces of display_categories, which was obsoleted but
  • trunk/lib/OpenGuides/Template.pm

    r554 r555  
    301301    if ( $prefs{latlong_traditional} ) {
    302302        foreach my $var ( qw( latitude longitude ) ) {
     303            next unless defined $vars{$var};
    303304            $vars{$var."_unmunged"} = $vars{$var};
    304305            $vars{$var} = Geography::NationalGrid->deg2string($vars{$var});
  • trunk/t/66_bug_latlong_representation.t

    r554 r555  
    1111    plan skip_all => "DBD::SQLite not installed";
    1212} else {
    13     plan tests => 2;
     13    plan tests => 4;
    1414
    1515    # Clear out the database from any previous runs.
     
    6666    $q->param( -name => "postcode", -value => "" );
    6767    $q->param( -name => "map_link", -value => "" );
    68     $q->param( -name => "os_x", -value => "532125" );
    69     $q->param( -name => "os_y", -value => "165504" );
     68    $q->param( -name => "os_x", -value => "532125" );   # these two lines are
     69    $q->param( -name => "os_y", -value => "165504" );   # the important ones
    7070    $q->param( -name => "username", -value => "Kake" );
    7171    $q->param( -name => "comment", -value => "foo" );
     
    9393    unlike( $output, qr/name="lat"\svalue="[-0-9]*d/,
    9494            "lat in non-dms format in distance search form" );
     95
     96    # Now write a node with no location data, and check that it doesn't
     97    # claim to have any when we display it.
     98    $q->param( -name => "os_x", -value => "" );
     99    $q->param( -name => "os_y", -value => "" );
     100    eval {
     101        local $SIG{__WARN__} = sub { die $_[0]; };
     102        $output = $guide->commit_node(
     103                                       return_output => 1,
     104                                       id => "Locationless Page",
     105                                       cgi_obj => $q,
     106                                     );
     107    };
     108    is( $@, "",
     109    "commit doesn't warn when prefs say dms format and node has no loc data" );
     110
     111    $output = $guide->display_node(
     112                                    return_output => 1,
     113                                    id => "Locationless Page",
     114                                  );
     115    unlike( $output, qr/latitude:/i,
     116            "node with no location data doesn't display a latitude" );
    95117}
Note: See TracChangeset for help on using the changeset viewer.