Skip to content

Record Breaker table broken if no average event #398

@LukeWoodward

Description

@LukeWoodward

If a parkrunner has no average event (e.g. they have only run at junior events or at events now closed), the Record Breaker table doesn't appear properly. A broken image appears and the table of events is empty:

image

There is also an error Failed to load resource: net::ERR_FILE_NOT_FOUND for "runner-record-breaker.png" in developer tools.

If you click on the 'show map' text in the above screenshot, the map appears, with no annotations, but you also get a JavaScript error Uncaught TypeError: Cannot read properties of undefined (reading 'lat') in developer tools.

The quickest fix to this is to not add the record-breaker challenge data if there is no event location data. This could be done by adding the condition data.parkrun_results.some(result => result.name in data.geo_data.data.events) to line 251 of challenges.js. This will cause the extension to no longer show the Record Breaker table. However, I don't know whether you would also want some text on the page explaining why the Record Breaker table is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions