Patch to avoid error when transactions refer to URIs of *purged* tickets


if you use the purgedead script to purge deleted tickets entirely from the
database, links and all other stuff related to the ticket are purged also.

if some other ticket refers to the purged ticket - even if the link has
been deleted - showing history fails a hard error page, which is resolved
by my attached patch.


the recorded transactions for adding or deleting links to the purged
tickets are not purged (and should not).

When trying to display the Description of the transaction, RT tries to load
the Object, which does not reside in database any more, failing with the
error below. The patch avoids asking the object for its URI, when it is not
found in the database.

error: Can’t call method “Id” on an undefined value at
/export/rt3/lib/RT/URI/ line 234.

context: …

229: =cut
231: sub AsString {
232: my $self = shift;
233: if ($self->IsLocal) {
234: return $self->loc(“ticket #[_1]”, $self->Object->Id);
236: }
237: else {

code stack:

rt_uri.patch (688 Bytes)