Item9677: Func::saveAttachment have NOW and not 1 Jan 1970 as default date

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine    
I'm writing WikiDrawPlugin atm, and testing on trunk - presumably this is an issue on 1.1.0 too

when my plugin calls

            Foswiki::Func::saveAttachment( $svgweb, $svgtopic, $svgattachment,
                                         { file => $tmpFile,
                                           comment => $svgcomment,
                                           hide => 0 
                                         } );

the resultant meta shows a date of 01 Jan 1970 - 00:00, or unix 0 in the attachment table.

I havn't tested against 1.0.x yet (or tmwiki even), but I will be surprised if this is correct. if it is correct, then the Func.pm docco needs updating to indicate that a filetime is compulsory.

-- SvenDowideit - 15 Sep 2010

I am sure that noone in this world can have any code that relies on the date being epoch 0.

Only reasonable default is time=now.

You cannot possibly break anything with respect to compatibility by treating this as a bug and fixing it to it default to now unless given a time.

-- KennethLavrsen - 15 Sep 2010

This problem was also present in 1.0.X.

I have verified by practical test.

I have made time() the default if no date is given. Noone can have used the epoch 0 as useful default.

Setting to Waiting For Release.

-- KennethLavrsen - 26 Sep 2010
 

ItemTemplate edit

Summary Func::saveAttachment have NOW and not 1 Jan 1970 as default date
ReportedBy SvenDowideit
Codebase 1.1.0 beta1, 1.0.10, 1.0.9, 1.0.8, 1.0.7, 1.0.6, 1.0.5, 1.0.5 beta1, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 1.0.0 beta3, 1.0.0 beta2, 1.0.0 beta1, trunk
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins Foswikirev:9350 Foswikirev:9351 Foswikirev:9356 Foswikirev:9357
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r10 - 04 Oct 2010, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License