Skip to content

Commit

Permalink
Fix for regression detailed in MapServer#6907 (WEB EMPTY). Introduce …
Browse files Browse the repository at this point in the history
…global means of configuring via config file (MS_EMPTY).
  • Loading branch information
sdlime committed Feb 18, 2024
1 parent 53540d1 commit 12fffad
Show file tree
Hide file tree
Showing 16 changed files with 1,007 additions and 860 deletions.
5 changes: 5 additions & 0 deletions etc/mapserver-sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ CONFIG
# MS_DEBUGLEVEL "5"
# MS_ERRORFILE "/opt/mapserver/logs/mapserver.log"

#
# Global Error Redirect Handling (see web object docs)
#
# MS_EMPTY "https://mapserver.org/"

#
# Default Map
#
Expand Down
6 changes: 6 additions & 0 deletions msautotest/query/6907_01.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG
ENV
MS_MAP_PATTERN "."
MS_EMPTY "http://localhost/6907_01.html"
END
END
9 changes: 6 additions & 3 deletions msautotest/query/6907_01.map
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Test 1: mode=itemquery - matching record
# RUN_PARMS: 6709_01_test001.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ANOK&qitem=cty_abbr' > [RESULT_DEMIME]
# RUN_PARMS: 6907_01_test001.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ANOK&qitem=cty_abbr' > [RESULT]
#
# Test 2: mode=itemquery - no matching record
# RUN_PARMS: 6709_01_test001.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ABCD&qitem=cty_abbr' > [RESULT_DEMIME]
# RUN_PARMS: 6907_01_test002.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ABCD&qitem=cty_abbr' > [RESULT]
#
# Test 3: mode=itemquery - no matching record, MS_EMPTY in config
# RUN_PARMS: 6907_01_test003.txt [MAPSERV] -conf 6907_01.conf QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ABCD&qitem=cty_abbr' > [RESULT]
MAP
NAME 'query'
EXTENT 125000 4785000 789000 5489000
Expand All @@ -16,7 +19,7 @@ MAP
NAME 'tmpl'
DRIVER 'TEMPLATE'
MIMETYPE 'text/html'
FORMATOPTION "FILE=template/query.tmpl"
FORMATOPTION "FILE=template/6907.tmpl"
END

LAYER
Expand Down
8 changes: 4 additions & 4 deletions msautotest/query/6907_02.map
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Test 1: mode=itemquery - matching record
# RUN_PARMS: 6709_02_test001.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ANOK&qitem=cty_abbr' > [RESULT_DEMIME]
# RUN_PARMS: 6907_02_test001.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ANOK&qitem=cty_abbr' > [RESULT]
#
# Test 2: mode=itemquery - no matching record
# RUN_PARMS: 6709_02_test001.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ABCD&qitem=cty_abbr' > [RESULT_DEMIME]
# RUN_PARMS: 6907_02_test002.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ABCD&qitem=cty_abbr' > [RESULT]
MAP
NAME 'query'
EXTENT 125000 4785000 789000 5489000
UNITS METERS

WEB
EMPTY 'https://mapserver.org/'
EMPTY 'http://localhost/6907_02.html'
QUERYFORMAT 'tmpl'
END

OUTPUTFORMAT
NAME 'tmpl'
DRIVER 'TEMPLATE'
MIMETYPE 'text/html'
FORMATOPTION "FILE=template/query.tmpl"
FORMATOPTION "FILE=template/6907.tmpl"
END

LAYER
Expand Down
Empty file removed msautotest/query/6907_03.conf
Empty file.
Empty file removed msautotest/query/6907_03.map
Empty file.
4 changes: 4 additions & 0 deletions msautotest/query/expected/6907_01_test001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Content-Type: text/html

Anoka:ANOK

4 changes: 4 additions & 0 deletions msautotest/query/expected/6907_01_test002.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Content-Type: text/html



5 changes: 5 additions & 0 deletions msautotest/query/expected/6907_01_test003.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Status: 302 Found
Uri: http://localhost/6907_01.html
Location: http://localhost/6907_01.html
Content-Type: text/html

4 changes: 4 additions & 0 deletions msautotest/query/expected/6907_02_test001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Content-Type: text/html

Anoka:ANOK

5 changes: 5 additions & 0 deletions msautotest/query/expected/6907_02_test002.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Status: 302 Found
Uri: http://localhost/6907_02.html
Location: http://localhost/6907_02.html
Content-Type: text/html

3 changes: 3 additions & 0 deletions msautotest/query/template/6907.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- MapServer Template -->
[resultset layer="bdry_counpy2"][feature][item name="cty_name"]:[item name="cty_abbr"] [/feature][/resultset]

Loading

0 comments on commit 12fffad

Please sign in to comment.