Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

JavaScript Error on Version Check #159

Closed
Cleptomania opened this issue May 31, 2022 · 0 comments
Closed

JavaScript Error on Version Check #159

Cleptomania opened this issue May 31, 2022 · 0 comments
Labels

Comments

@Cleptomania
Copy link
Contributor

Cleptomania commented May 31, 2022

Since moving to version 1.9.1 this has introduced a new point to the version number(e.g. previously it was 1.9, 1.8, 1.7, etc)

In the templates/index.phtml file there exists some Javascript code to check for the latest version. With this version number in place it throws a JavaScript error in the browser with SyntaxError: Unexpected number on line 278.

This is because we're trying to represent the version as a number, with more than one decimal place now.

The previous comparison was simply a greater than check, but now with a new point release, it needs to read the version as a string, and individually check each component of the version to really be able to check it.

For me this was a fatal error in Chrome 102.0.5005.61(didn't test other browsers) and caused the entire application to be unable to show cachegrind files. As a stop gap for myself I just threw quotes around the version number such that line 278 becomes

if (data.latest_version>"<?php echo Webgrind_Config::$webgrindVersion?>") {

instead of

if (data.latest_version><?php echo Webgrind_Config::$webgrindVersion?>) {

This fixes the error and causes the application to function properly again, however it does mean that the version check doesn't work, and it will always consider you up to date.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants