Re: too many 'changed' entries

Mel Hatzis <[email protected]>
Newsgroups gmane.comp.bug-tracking.gnats.general
Message-ID <[email protected]>
On 03/27/2003 06:04 AM, Dirk Schenkewitz submitted:

>Dirk Schenkewitz schrieb:
>  
>
>>Hi All,
>>
>>Can someone give me a hint to get rid of this:
>>
>>Every time a PR is edited (via Gnatsweb) it happens that stuff is noted as
>>'changed' in the Audit-Trail, although the only "change" was the formatting,
>>and even there the user did not change anything - all of this happens auto-
>>matically.
>>
>>As an example, here is something I found in one audit-trail.
>>/
>>| Description-Changed-From-To: In einer Mehrfachauswahl wird auf einen String mit einem '#D ' abgefragt. Entspricht der Wert,
>>| verläuft zunächst alles gut. Entspricht der Wert nicht und muss er nur überlesen werden, kommt Fehler: Variable Konstante
>>| erwartet.
>>| ->In einer Mehrfachauswahl wird auf einen String mit einem '#D
>>| ' abgefragt. Entspricht der Wert, verläuft zunächst alles
>>| gut. Entspricht der Wert nicht und muss er nur überlesen
>>| werden, kommt Fehler: Variable Konstante erwartet.
>>\
>>
>>We're using Gnatsweb v3.99.3, Gnats v4.0-beta1 (taken from the GnatsWeb
>>display) - is this a known bug which can be removed by updating, perhaps ?
>>Or did I make a configuration mistake ?
>>Or is it the fault of my favourite browser (Opera 7.0), running on Win-NT 4.0 ?
>>    
>>
>
>It can't be the browser, other people here have the same problem
>and they use IE or Netscape (4.7x to 7.x) or Mozilla.
>
>Has nobody else observed this ?
>(Please, people, give me a hint, even if it is something obvious - 
>right now i'm just out of ideas.)
>
I noticed this too. In my case, I setup a field as 'required' and
it wasn't working via gnatsweb, because gnatsweb was inserting a
newline (thereby making the field look like it had a value).

I fixed it by changing the 'fix_multiline_val' sub, as follows:

sub fix_multiline_val
{
  my $val = shift;
  $val =~ s/\r\n?/\n/g;
  $val .= "\n" unless $val =~ /\n$/;
  if ($val =~ /^\s*$/)
  {
    # don't allow whitespace values to circumvent 'required' fields
    $val = "";
  }
  $val;
}

This basically prevents whitespace only values from being entered
as the (multiline) field value which I consider to be a good fix.

This should help you in the case where a newly created PR is edited
for the first time - since this is when gnatsweb will add the
newline, thereby changing the field and adding a change log to the
audit trail.

Hope this helps.

--
Mel Hatzis

>
>Can/should I ask somewhere else ? But then, where (or whom) ?
>
>Slowly getting desperate...
>	dirk
>  
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.