From 899f8ba4268c3323b8de7f63290170b6598c48be Mon Sep 17 00:00:00 2001 From: vfilippov Date: Tue, 23 Aug 2011 22:17:45 +0000 Subject: [PATCH] Bug 70605 git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1346 6955db30-a419-402b-8a0d-67ecbb4d7f56 --- Bugzilla/Bug.pm | 2 ++ Bugzilla/WebService/Bug.pm | 17 ++++++++++++++--- Bugzilla/WebService/Server.pm | 1 + checksetup.sh | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 65ca20cf6..7aca6f817 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -2116,6 +2116,8 @@ sub _check_bugid_field sub fields { my $class = shift; + # FIXME bugzilla.dtd should be autogenerated + # FIXME change useplatform/useopsys/useqacontact to "field(xxx).is_obsolete" my @fields = ( # Standard Fields diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 2019ce33b..1af2782e9 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -785,6 +785,7 @@ sub _bug_to_hash { # All the basic bug attributes are here, in alphabetical order. # A bug attribute is "basic" if it doesn't require an additional # database call to get the info. + # FIXME remove hardcode, use global "fielddefs" metadata my %item = ( alias => $self->type('string', $bug->alias), classification => $self->type('string', $bug->classification), @@ -793,8 +794,6 @@ sub _bug_to_hash { id => $self->type('int', $bug->bug_id), is_confirmed => $self->type('boolean', $bug->everconfirmed), last_change_time => $self->type('dateTime', $bug->delta_ts), - op_sys => $self->type('string', $bug->op_sys), - platform => $self->type('string', $bug->rep_platform), priority => $self->type('string', $bug->priority), product => $self->type('string', $bug->product), resolution => $self->type('string', $bug->resolution), @@ -807,6 +806,17 @@ sub _bug_to_hash { whiteboard => $self->type('string', $bug->status_whiteboard), ); + # FIXME change toggle method to fielddefs.is_obsolete + if (Bugzilla->params->{useopsys} && filter_wants $params, 'op_sys') + { + $item{op_sys} = $self->type('string', $bug->op_sys); + } + + # FIXME change toggle method to fielddefs.is_obsolete + if (Bugzilla->params->{useplatform} && filter_wants $params, 'platform') + { + $item{platform} = $self->type('string', $bug->rep_platform); + } # First we handle any fields that require extra SQL calls. # We don't do the SQL calls at all if the filter would just @@ -845,7 +855,8 @@ sub _bug_to_hash { @{ $bug->keyword_objects }; $item{'keywords'} = \@keywords; } - if (filter_wants $params, 'qa_contact') { + if (Bugzilla->params->{useqacontact} && + filter_wants $params, 'qa_contact') { my $qa_login = $bug->qa_contact ? $bug->qa_contact->login : ''; $item{'qa_contact'} = $self->type('string', $qa_login); } diff --git a/Bugzilla/WebService/Server.pm b/Bugzilla/WebService/Server.pm index 71c790e8e..e4788c7c0 100644 --- a/Bugzilla/WebService/Server.pm +++ b/Bugzilla/WebService/Server.pm @@ -42,6 +42,7 @@ sub datetime_format_inbound { sub datetime_format_outbound { my ($self, $date) = @_; + return '1970-01-01T00:00:00' if !$date; my $time = $date; if (blessed($date)) { diff --git a/checksetup.sh b/checksetup.sh index a24fb6c7c..588deabae 100755 --- a/checksetup.sh +++ b/checksetup.sh @@ -1,2 +1,2 @@ #!/bin/sh -LD_PRELOAD=/usr/lib/i386-linux-gnu/libstdc++.so.6:/lib/libuuid.so.1 perl checksetup.pl --no-chmod --no-templates +perl checksetup.pl --no-chmod --no-templates