View Issue Details

IDProjectCategoryView StatusLast Update
719RackTablesdefaultpublic2013-03-02 16:35
Reportersauron Assigned Toinfrastation  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.20.3 
Target Version0.20.4Fixed in Version0.20.4 
Summary719: Major regression in date handling
DescriptionAfter a recent upgrade from Racktables 0.19.2 to 0.20.3, almost all dates entered have disappeared from the interface.

Steps To ReproduceFor an example object in my DB:-


> select * from AttributeValue where object_id = 320;
+-----------+------------+---------+--------------+------------+-------------+
| object_id | object_tid | attr_id | string_value | uint_value | float_value |
+-----------+------------+---------+--------------+------------+-------------+
| 320 | 4 | 1 | 0832QAN125 | NULL | NULL |
| 320 | 4 | 2 | NULL | 50015 | NULL |
| 320 | 4 | 4 | NULL | 1395 | NULL |
| 320 | 4 | 21 | 21/04/2013 | NULL | NULL |
| 320 | 4 | 22 | 10/09/2009 | 1255046400 | NULL |
+-----------+------------+---------+--------------+------------+-------------+

in 0.19.2, attribute ids 21 and 22 (support contract expiration and HW warranty expiration) were strings, but with the new version, they have been changed to "date" data types. These fields are no longer visible, and this is affecting all objects in the database, thus all my support/warranty information is no longer visible across the board.
Additional InformationAdditionally, the date handling for the new field types doesn't appear to work properly - or not as expected, anyway. The config value DATETIME_FORMAT appears to be used for displaying dates, but not for entering them, and the entry is a simple wrapper around strtotime(), which seems unable to handle "/" separators, among other things. Using the PHP parse_date() function would probably be more robust, but for non US users, there is still an issue with date output being controlled by the DATETIME_FORMAT, but input localisation seems to be governed by the php.ini date.timezone setting, which has the potential for a lot of confusion.
TagsNo tags attached.

Activities

infrastation

infrastation

2013-01-09 21:20

administrator   ~0001081

This bug is also described here:

http://www.freelists.org/post/racktables-users/Upgrade-from-01912-to-01914-and-date-formats,9

I will work on fixing it.
infrastation

infrastation

2013-02-28 20:10

administrator   ~0001177

The best solution seems to be using DateTime::createFromFormat().
infrastation

infrastation

2013-03-02 16:35

administrator   ~0001179

The commit message below explains the details of the fix, which will be available in the next stable release (0.20.4). Thanks for the report!

https://github.com/RackTables/racktables/commit/17c14702dcabf693b64c1e0ae64c12eaaa2f6f99

Issue History

Date Modified Username Field Change
2013-01-09 13:18 sauron New Issue
2013-01-09 21:20 infrastation Note Added: 0001081
2013-01-09 21:20 infrastation Assigned To => infrastation
2013-01-09 21:20 infrastation Status new => assigned
2013-02-19 21:55 infrastation Target Version => 0.20.4
2013-02-28 20:10 infrastation Note Added: 0001177
2013-03-02 16:35 infrastation Note Added: 0001179
2013-03-02 16:35 infrastation Status assigned => closed
2013-03-02 16:35 infrastation Resolution open => fixed
2013-03-02 16:35 infrastation Fixed in Version => 0.20.4