When I submit an edit (sub submitedit), sometimes the gnats
server returns an error to the lock command (e.g., "490 ...").
Gnatsweb did not catch that error, and eventually generated a
misleading error message to the effect that:
&$err_sub("PR $pr has been modified since you started editing it.",
"Please return to the edit form, press the Reload button, "
. "then make your edits again.\n"
. "<pre>Last-Modified was '$fields{'Last-Modified'}'\n"
. "Last-Modified is now '$oldfields{'Last-Modified'}'</pre>\n");
because %oldfields did not have any significant values in it.
My fix was to modify lockpr to look for an undef returned by
client_cmd("lock $pr $user") and to then return undef itself
in that case. Further, to modify submitedit to detect an "undef"
return from lockpr and then to call &$err_sub with $gnats::FULL_ERRSTR
to print the server error to the user.
I am sure my quick hack is not the best approach to this problem,
so I am sending merely this explanation in hopes that Gerald or
someone else can generate a better fix.