Bug 734632

Summary: the Bug.attachments() xmlrpc function doesn't work for some existing attachments
Product: [Community] Bugzilla Reporter: Tony Fu <tfu>
Component: WebServiceAssignee: Simon Green <sgreen>
Status: CLOSED WONTFIX QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.6CC: ebaak, rlandry, sgreen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-19 03:44:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 723036    

Description Tony Fu 2011-08-31 02:15:58 UTC
Description of problem:


When using the Bug.attachments() to get some attachments' info, the following error occurs

Can't call method "iso8601" on an undefined value at /var/www/html/bugzilla/Bugzilla/WebService/Server.pm line 60.

How reproducible:

always:

Step:

Using Bug.attachments() to get rh bz attachment #447108 [details]

 
Actual results:
Can't call method "iso8601" on an undefined value at /var/www/html/bugzilla/Bugzilla/WebService/Server.pm line 60.


Expected results:
should return attachment's info


Additional info:
the Bug.attachments() works for some attachments, but doesn't work for others

Comment 1 Simon Green 2011-08-31 04:09:06 UTC
The problem is caused because the modification_date value in the attachment table is set to '0000-00-00'. Trying to convert this to a valid date of course won't work.

This column is set to NOT NULL in the database. Bugzilla::Attachments correctly will set this value to the creation date if it is not specified.

However, the hwcert code directly inserts into the database, and thus as a modification date was not provided, MySQL used '0000-00-00' as the default date for a NOT NULL column.

I have asked Tony to either update his code or (preferably) use the RPC call to add attachments to bugs.

Once this is done, I will then get a sysadmin to run SQL to update the migration date to the creation date when it is set to '0000-00-00'

  -- simon