Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006215TestLinkCustom fieldspublic2014-02-19 08:352014-04-25 17:38
ReporterJuan1 
Assigned Tofman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSUbuntu 13 ; RHEL6OS Version64bit
Product Version1.9.9 (2013 Q4 - bug fixing) 
Fixed in Version1.9.10 (2014 Q1 - bug fixing) 
Summary0006215: Custom DATE fields in 64bit OS systems show 30/10/-2 by default instead of being empty
DescriptionOnly happens in 64bit Linux systems, not reproducible on 32bit ones.

Custom DATE fields shows date "30/10/-2" by default when it should be empty.

I tracked the error to the file: "/lib/functions/date_api.php"

In line 129, to the call mktime(...), when the parameters $y, $m, $d are set to "-1" in line 110.

On 32bit systems, when passing mktime(0,0,0,-1,-1,-1) returns false.
On 64bit systems it returns a long negative value which causes the error.
Steps To Reproduce1. Create a DATE custom field and assign it to a Test Plan.

2. Create a new Test Plan.

3. The custom field in Test Plan will show 30/10/-2 instead of being empty.
Additional InformationI temporarily fixed it by replacing:
  $time = mktime(0, 0, 0, $m, $d, $y);

with:
  if($m == -1){
    $time = 0;
  } else {
    $time = mktime(0, 0, 0, $m, $d, $y);
  }
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL 5.5
BrowserAny
PHP Version5.4.24
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Files? file icon date_api.php [^] (6,303 bytes) 2014-02-19 08:35
png file icon Screenshot_DATE.png [^] (76,279 bytes) 2014-02-19 09:36

- Relationships
child of 0006048closedfman Availables hot-fixes for 1.9.9 & How To get full fixed package from gitorious 

-  Notes
(0020490)
fman (administrator)
2014-02-27 00:26

Seems to be php issue. Have you checked?
Thanks for workaround
(0020494)
Juan1 (reporter)
2014-02-27 09:48

I think that is PHP when we pass a negative year value to the function mktime(), as it does not seem to control it properly on 64bit PHP installations (and gives the negative number).

It still happens on the latest PHP 5.5 version on 64bit systems, and I found no fixes for PHP (therefore I made that workaround).
(0020527)
fman (administrator)
2014-03-04 17:30

https://gitorious.org/testlink-ga/testlink-code/commit/98246156efd4f045406d7ed23800a452e86879fc [^]
(0020822)
fman (administrator)
2014-04-25 17:38

1.9.10 released

- Issue History
Date Modified Username Field Change
2014-02-19 08:35 Juan1 New Issue
2014-02-19 08:35 Juan1 File Added: date_api.php
2014-02-19 09:36 Juan1 File Added: Screenshot_DATE.png
2014-02-27 00:26 fman Note Added: 0020490
2014-02-27 00:27 fman Assigned To => fman
2014-02-27 00:27 fman Status new => feedback
2014-02-27 09:48 Juan1 Note Added: 0020494
2014-02-27 09:48 Juan1 Status feedback => assigned
2014-03-04 17:30 fman QA Team - Task Workflow Status => READY FOR TESTING
2014-03-04 17:30 fman Note Added: 0020527
2014-03-04 17:30 fman Status assigned => resolved
2014-03-04 17:30 fman Fixed in Version => 1.9.10 (2014 Q1 - bug fixing)
2014-03-04 17:30 fman Resolution open => fixed
2014-03-04 17:31 fman Relationship added child of 0006048
2014-04-25 17:38 fman Note Added: 0020822
2014-04-25 17:38 fman Status resolved => closed



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker