Extension talk:CreateRedirect

From MediaWiki.org
Jump to navigation Jump to search

Create redirect from already existing page[edit]

Creates a redirect with an already existing page without any warning, feedback, or settings to change this behavior.

Error with 1.13[edit]

When I go to Special pages, it fails. I traced the error to line 43 in .body.php. The line should read

if ( $messagesLoaded ) return true;

This fixes it for me.


i18n doesn't work[edit]

The i18n-file does only work in the list on Special:Specialpages, but not on Special:Createredirect.

The English messages in this form (CreateRedirect.body.php) seem to be hardcoded:

    function execute( $par ) {
        global $wgRequest, $wgOut, $wgTitle, $wgUser;
        
        // 1. Do some prep stuff. We call $this->setHeaders() (a method of SpecialPage) for the page, and we also initialize $output, which will hold the text output to serve with the page.
        $this->setHeaders();
        $output = "";
        
        // 2. Break from here: "crWrite" determines whether we're serving the form or we're performing the write routine. We send it along with the form on submission, so if we see a POST var "crWrite", then we've got form data to process; if it's not there, then we don't have form data to process, and we have to serve the form.
        if(!$wgRequest->getVal('crWrite')) { // Serve the form!
            // 1. Get the local URL for the "action" param, used by <form>. This points the form back to this page (again), where if crWrite exists (which it does,) we process the submitted form.
            $action = $wgTitle->escapeLocalURL();
            $crTitle = $wgRequest->getText("crTitle"); // Also retrieve "crTitle". If this GET var is found, we autofill the "Redirect to:" field with that text.
            
            // 2. Start rendering the output! The output is entirely the form. It's all HTML, and may be self-explanatory.
            $output .= "<p>Using the form below, you can create a redirect page or replace an existing page with a redirect.</p>";
            $output .= <<<END
<form id="redirectform" name="redirectform" method="post" action="$action" enctype="multipart/form-data">
<table>
<tr>
<td><label for="crOrigTitle">Artikkelnavn:</label></td>
<td><input type="text" name="crOrigTitle" id="crOrigTitle" size="60" tabindex="1" /></td>
</tr>
<tr>
<td><label for="crRedirectTitle">Omdiriger til:</label></td>
<td><input type="text" name="crRedirectTitle" id="crRedirectTitle" value="{$crTitle}" size="60" tabindex="2" /></td>
</tr>
<tr>
<td />
<td><input type="submit" name="crWrite" id="crWrite" value="Opprett" tabindex="4" /></td>
</tr>
</table>
</form>
END;
            $output .= <<<END
<script language="javascript">
//<![CDATA[
document.redirectform.crOrigTitle.focus();
//]]>
</script>
END;

Marius, 9. Nov 2009

Does it allow dynamic redirects?[edit]

Will it allow me to create a dynamic redirect? Such as:

#REDIRECT [[User_talk:Technical_13/{{#time:Y|now -5 hours}}/{{#expr:ceil({{#time:n|now -5 hours}}/3)}}]]

To redirect the visitor to the correct section of my talk page (which I have decided to divide into quarters). -- ShoeMaker   ( Contributions Message )   17:06, 18 June 2012 (UTC)

Download broken[edit]

This extension doesn't seem to exist in the repository anymore. --Stormwind (talk) 23:16, 8 August 2012 (UTC)

Patch of extension[edit]

I submitted a patch for extension here: https://gerrit.wikimedia.org/r/#/c/57410/ --Toniher (talk) 20:39, 3 April 2013 (UTC)

it doesn't work for me[edit]

I guess the catpcha is the problem.--Cihuaweb (talk) 22:33, 8 August 2015 (UTC)