Geeklog Bugtracker
Geeklog

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000866 [Geeklog] Feature Requests minor N/A 2009-05-01 10:32 2009-05-08 03:47
Reporter Ivy View Status public  
Assigned To
Priority low Resolution open  
Status confirmed   Product Version 1.5.2sr4
Summary 0000866: version_compare error in sr*
Description 'version_compare()' does not work well in Geeklog1.5.2sr*.

ex)if (version_compare(VERSION, '1.5.2') < 0) {
Additional Information
Tags No tags attached.
Target Future Release
Attached Files

- Relationships

-  Notes
User avatar (0000695)
dhaun (administrator)
2009-05-02 03:44

Specifically, it looks like any sort of suffix will cause that version number to be considered lower than the version number without the suffix.

I.e. 1.5.2sr4, 1.5.2b1, 1.5.2rc1 are all considered version numbers lower than 1.5.2

I guess we could provide our own function, COM_versionCompare or the like. But what exactly do we want it to return?

Consider: 1.6.0b1 < 1.6.0rc1 < 1.6.0 < 1.6.0sr1
User avatar (0000714)
Ivy (reporter)
2009-05-07 11:03

When upgrade: 1.4.1 to 1.5.2sr4, then occured.

from:
if (version_compare(VERSION, '1.5.2') < 0) {

to:
preg_match("/^(\d+\.\d+\.\d+).*$/", VERSION, $match);
 if (version_compare($match[1], '1.5.2') < 0) {

It may work.
User avatar (0000715)
dhaun (administrator)
2009-05-07 11:13

version_compare('1.4.1', '1.5.2sr4') returns -1, so that works as expected.
User avatar (0000716)
Ivy (reporter)
2009-05-07 11:58

CUSTOM_mail() use version_compare() for working in any version.

CUSTOM_mail works differently in VERSION '1.5.2' '1.5.2sr*' from VERSION '1.4.1'.

CUSTOM_mail:
http://code.google.com/p/geeklog-jp/source/browse/trunk/geeklog-1-jp/system/custom/custom_mail_jp.php
User avatar (0000717)
dhaun (administrator)
2009-05-07 14:45

Sorry, I don't understand that comment. version_compare works as expected for comparing 1.4.1 and 1.5.2sr4. So what's the problem there?

As I wrote above, it may make sense to have our own version compare function so that you can compare, say, 1.5.2rc1 and 1.5.2sr4 and get a sensible result. But that shouldn't stop you from using version_compare for CUSTOM_mail for now.
User avatar (0000719)
Ivy (reporter)
2009-05-08 01:35

I see. 'version_compare()' works well in any Geeklog programs, then it's okey.

- Issue History
Date Modified Username Field Change
2009-05-01 10:32 Ivy New Issue
2009-05-02 03:44 dhaun Note Added: 0000695
2009-05-02 03:44 dhaun Status new => feedback
2009-05-07 11:03 Ivy Note Added: 0000714
2009-05-07 11:13 dhaun Note Added: 0000715
2009-05-07 11:58 Ivy Note Added: 0000716
2009-05-07 14:45 dhaun Note Added: 0000717
2009-05-08 01:35 Ivy Note Added: 0000719
2009-05-08 03:47 dhaun Target => Future Release
2009-05-08 03:47 dhaun Priority normal => low
2009-05-08 03:47 dhaun Reproducibility always => N/A
2009-05-08 03:47 dhaun Status feedback => confirmed
2009-05-08 03:47 dhaun Projection none => minor fix
2009-05-08 03:47 dhaun Category Bugs => Feature Requests
2009-05-08 03:47 dhaun Target Version => Future


Copyright © 2000 - 2009 Mantis Group
Hosted by pair.com
Powered by Mantis Bugtracker