Skip to content

Route segment parsing error for mexnlm #976

Description

@1ec5

https://travelmapping.net/user/mapview.php?sys=mexnlm fails to load any routes for me. I get the following error in the browser console:

Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    parseSegmentAndRouteData https://travelmapping.net/lib/mapviewfuncs.js:391
    jQuery 4
mapviewfuncs.js:391:23

Setting a breakpoint on the function in question, I see this instead of JSON (truncated for readability):

<br />
<b>Warning</b>:  Undefined array key "traveler" in <b>/fast/www/tm/lib/getRegionSystemSegments.php</b> on line <b>44</b><br />
<br />
<b>Warning</b>:  Undefined array key "traveler" in <b>/fast/www/tm/lib/getRegionSystemSegments.php</b> on line <b>64</b><br />
{"roots":["mexnl.m001","mexnl.m001","mexnl.m001","mexnl.m001","mexnl.m001","mexnl.m001","mexnl.m001","mexnl.m001","mexnl.m002","mexnl.m002","mexnl.m002","mexnl.m002","mexnl.m002","mexnl.m002","mexnl.m003","mexnl.m003","mexnl.m003","mexnl.m003cat","mexnl.m004","mexnl.m004","mexnl.m004","mexnl.m004","mexnl.m004","mexnl.m004","mexnl.m005","mexnl.m005","mexnl.m005","mexnl.m006","mexnl.m006","mexnl.m006",

The warnings in HTML format seem to be tripping up the JSON parser.

Reproduces in Firefox 152.0b7 on macOS in private browsing mode.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions