Remove timed redirect/refresh on "return to" pages
Closed, ResolvedPublic

Description

Author: fernandoacorreia

Description:
In function returnToMain() of OutputPage, use a global variable instead of the
magic number 10 so the refresh delay can be configured in LocalSettings.php.

The default delay may be too long. For instance with 5 seconds the message still
could be read and the user would not have to click the link.

Proposed solution:

$wgRedirectDelay = 10;


Version: unspecified
Severity: enhancement

Details

Reference
bz9153
bzimport set Reference to bz9153.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Mar 2 2007, 7:33 PM

robchur wrote:

"Too long" and "too short", for reading purposes, is subjective.

fernandoacorreia wrote:

Agreed. That's why the wiki administrator should be able to decide the issue.
For instance, why 10 instead of 9 or 11?

ayg wrote:

Why do we have a delayed redirect anyway? Those are evil. Slow readers,
opening in another tab, tiny screens so you haven't even scrolled down to the
message before it goes away, slow output devices like screen readers . . .

brion added a comment.Mar 6 2007, 7:06 PM

We should remove the delayed redirects entirely; they're poorly accessible and
annoying to everyone.

fernandoacorreia wrote:

Agreed. I think that would make implementation of Bug 7129 even more valuable.

demon added a comment.Jul 10 2007, 2:00 PM

As a temporary fix until/unless all redirects are made seamless (either via AJAX or removing them entirely), here's a fix for OutputPage.php. Setting $wgRedirectDelay in DefaultSettings to 10 will leave functionality as it is now, but of course users can override that in their LocalSettings

Index: OutputPage.php

  • OutputPage.php (revision 23952)

+++ OutputPage.php (working copy)
@@ -1076,7 +1076,7 @@

    • @param $returnto page title to return to. Default is Main Page. */ public function returnToMain( $auto = true, $returnto = NULL ) {
  • global $wgUser, $wgOut, $wgRequest;

+ global $wgUser, $wgOut, $wgRequest, $wgRedirectDelay;

		
		if ( $returnto == NULL ) {
			$returnto = $wgRequest->getText( 'returnto' );

@@ -1100,7 +1100,7 @@

		$r = wfMsg( 'returnto', $link );
		if ( $auto ) {
  • $wgOut->addMeta( 'http:Refresh', '10;url=' . $titleObj->escapeFullURL() );

+ $wgOut->addMeta( 'http:Refresh', $wgRedirectDelay';url=' . $titleObj->escapeFullURL() );

		}
		$wgOut->addHTML( "\n<p>$r</p>\n" );
	}

ayg wrote:

Timed redirect removed in r23979.

Add Comment