Page MenuHomePhabricator

Link with action=edit&redlink=1 leading to existing page should redirect to plain view
Closed, ResolvedPublic

Description

When an outdated red link is clicked, and the target page has been created in the meantime, MediaWiki should not display edit form, even though action=edit has been given. It should redirect to normal page view.


Version: unspecified
Severity: enhancement
URL: http://en.wikipedia.org/w/index.php?title=Foo&action=edit&redlink=1

Details

Reference
bz15242

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:18 PM
bzimport set Reference to bz15242.
bzimport added a subscriber: Unknown Object (MLST).

Created attachment 5197
A simple patch for this enhancement

(Why do I always receive “The bug was created successfully, but attachment creation failed.” when trying to create a new bug with an attachment included in the first commit?)

attachment EditPage.php.diff ignored as obsolete

That patch looks bad. The current redlink logic is part of EditForm::readOnlyPage(), if that is a bad location then it should be moved, rather than duplicated.

Created attachment 5201
A slightly refactored patch

Well, to be honest, I did not see much of common “redlink logic”. But OK, the $wgRequest->getBool and the $wgOut->redirect can be factored out. (Even though the result does not seem too much better to me.)

attachment EditPage.php.diff ignored as obsolete

Created attachment 5280
Fixed patch

There was a tiny bug in the patch, fixed.

Attached:

I'd move '$wgOut->redirect( $this->mTitle->getFullUrl() );' out of the autoredirect function and leave readonlypage() alone.

(In reply to comment #5)

I'd move '$wgOut->redirect( $this->mTitle->getFullUrl() );' out of the
autoredirect function and leave readonlypage() alone.

Mmmm… you mean like in the original version of the patch (attachment 5197)? ;-)

happy.melon.wiki wrote:

This was done in r48039.