Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
297 views
in Q2A Core by

Here's a strange problem, in the admin/plugins list:

The plugin is up to date, and here's the meta:

    Plugin Name: History
    Plugin URI: https://github.com/NoahY/q2a-history
    Plugin Description: Adds complete activity history list to user profile
    Plugin Version: 1.0
    Plugin Date: 2011-10-26
    Plugin Author: NoahY
    Plugin Author URI: http://www.question2answer.org/qa/user/NoahY
    Plugin License: GPLv3
    Plugin Minimum Question2Answer Version: 1.4
    Plugin Update Check URI: https://raw.github.com/NoahY/q2a-history/master/qa-plugin.php

It's the only plugin that's causing problems, the rest show the proper info.

Q2A version: 1.5
by
Is there any extra space in either your version or the Update Check URI version?

1 Answer

0 votes
by
selected by
 
Best answer

The problem is with the javascript:

qa_version_check('https:\/\/github.com\/NoahY\/q2a-history\/raw\/master\/qa-plugin.php', 'Plugin Version', 1.0, 'Plugin URI', 'version_check_34965829881f4ae7da5c2e957c8ad092');

It's sending the version as 1.0, rather than '1.0', which turns it into 1; strcmp then compares the remote string '1.0' with the string '1' and gives a return value of 2, rather than 0, triggering the update check.

So, it is necessary to either require plugins to avoid redundant 0 decimal places, or change line 137 in qa-page-admin-plugins.php to read:

"qa_version_check(".qa_js($metadata['update']).", 'Plugin Version', ".qa_js($metadata['version'],true).", 'Plugin URI', ".qa_js($elementid).");"

The 'true' forces it to use quotes for the version number.

by
Thanks and congrats on finding the first bug in 1.5 :)

I'll fix this for 1.5.1.
by
I should get a badge for that ;)

Thanks for your work.
...