jision / rock-php

Automatically exported from code.google.com/p/rock-php
0 stars 0 forks source link

Date() type not handled properly #118

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create GridFS entry
2. Click update for an entry the files collection
3. Click save without modifying anything

What is the expected output? What do you see instead?
Since the "uploadDate" field was represented as a string in the update textbox, 
it was also saved as a string. Because of that, the entry is no longer GridFS 
compliant, as the specification states that uploadDate must be a Date type.

As a result, the JAVA driver (and possibly other ones too) crash due to type 
conversions when trying to load such an entry. (tries to cast field into a Date 
object when it's in fact a String)

What version of the product are you using?
v1.0.11

On what operating system?
Ubuntu

Web server and PHP version:
Apache/PHP5

Please provide any additional information below.
This is also an issue for non gridFS documents. The default behaviour should be 
that in the update textbox, dates are represented as
"field" : new Date("Thu, 24 Feb 2011 00: 44: 31 +0200")
as opposed to current:
"field" : "Thu, 24 Feb 2011 00: 44: 31 +0200"

Original issue reported on code.google.com by kosta.kr...@gmail.com on 6 Mar 2011 at 6:00

GoogleCodeExporter commented 8 years ago
Thank you, we will check it later.

Original comment by iwind....@gmail.com on 8 Mar 2011 at 3:03

GoogleCodeExporter commented 8 years ago
fixed in svn, please check it out from svn://ifphp.cn/rockmongo

Original comment by iwind....@gmail.com on 9 Apr 2011 at 5:57

GoogleCodeExporter commented 8 years ago

Original comment by iwind....@gmail.com on 9 Apr 2011 at 5:57