Ticket #3869 (reopened defect)

Opened 4 years ago

Last modified 4 years ago

Can't view History for deleted EPrints

Reported by: tdb01r Owned by:
Priority: unset Milestone: 3.2.4
Component: - Version:
Severity: normal Keywords:
Cc:

Description

Dies when the parent of the History object can't be accessed, in Storage::Local.

Change History

Changed 4 years ago by tdb01r

  • status changed from new to closed
  • resolution set to fixed

Resolved by r5799.

Changed 4 years ago by tmb

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 4 years ago by tmb

r5799 fixes trying to get non-existant files, and r5695 goes some way to fix the rendering.

EPrints::DataObj::History::render_modify also needs to check that $r_file_new and $r_file_old are valid before calling EPrints::XML::Parse.

@@ -541,14 +541,14 @@
 
 	my $r_file = $self->get_stored_file( "dataobj.xml" );
 
-	unless( defined( $r_file ) )
+	my $r_file_new;
+	if( !defined( $r_file ) || !defined($r_file_new = $r_file->get_local_copy) )
 	{
 		my $div = $self->{session}->make_element( "div" );
 		$div->appendChild( $self->{session}->html_phrase( "lib/history:no_file" ) );
 		return $div;
 	}
 
-	my $r_file_new = $r_file->get_local_copy();
 	my $file_new = EPrints::XML::parse_xml( "$r_file_new" );
 	my $dom_new = $file_new->getFirstChild;
 
@@ -560,7 +560,8 @@
 		$r_file = $previous->get_stored_file( "dataobj.xml" );
 	}
 
-	unless( defined( $r_file ) )
+	my $r_file_old;
+	if( !defined( $r_file ) || !defined($r_file_old = $r_file->get_local_copy) )
 	{
 		my $div = $self->{session}->make_element( "div" );
 		$div->appendChild( $self->{session}->html_phrase( "lib/history:no_earlier" ) );
@@ -568,7 +569,6 @@
 		return $div;
 	}
 
-	my $r_file_old = $r_file->get_local_copy();
 	my $file_old = EPrints::XML::parse_xml( "$r_file_old" );
 	my $dom_old = $file_old->getFirstChild;
Note: See TracTickets for help on using tickets.