Ticket #4045 (closed defect: fixed)

Opened 13 months ago

Last modified 13 months ago

Edit page phrases not working on http pages

Reported by: tmb Owned by:
Priority: Customer Report Milestone: EPrints 3.3.10
Component: Screen Plugins Version: unspecified
Severity: normal Keywords:
Cc:

Description

On repositories with $c->{securehost} set, Edit page phrases does not work on http pages, for example the simple or advanced search.

The Edit page phrases screen loads, but phrases cannot be edited - the AJAX call to  http://repository.host/cgi/users/home is redirected to https and presumably this causes problems with browsers - ie. loading secure URL in nonsecure page (user reported an "AJAX Exception: Type mismatch" error message).

Suggested fix is to make Admin::Phrases construct a https URL accordingly:

--- perl_lib/EPrints/Plugin/Screen/Admin/Phrases.pm.orig	2012-04-30 16:39:15.397637000 +0100
+++ perl_lib/EPrints/Plugin/Screen/Admin/Phrases.pm	2012-04-30 16:57:17.010839000 +0100
@@ -328,7 +328,12 @@
 {
 	my( $self ) = @_;
 
-	my $uri = URI->new( $self->{session}->current_url( query => 1 ) );
+	my $uri = URI->new( $self->{session}->current_url(
+		query => 1,
+		host => 1,
+		scheme => defined $self->{session}->config( "securehost" ) ? "https" : "http",
+	) );
 	$uri->query_form(
 		$uri->query_form,
 		edit_phrases => "yes"

Change History

Changed 13 months ago by tdb01r

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

Resolved by r7662/r7664.

(Note: current_url() will fall back to http: if securehost is not defined.)

Note: See TracTickets for help on using tickets.