Page MenuHomePhabricator

Prefix option for inputbox
Closed, ResolvedPublic

Description

Author: katiefromuncyc

Description:
There are two issues we've run into with inputbox (in using it for the en.wp mediation cabal):

  1. There's no prefix option usable on the English Wikipedia. Code for this exists (http://meta.wikimedia.org/wiki/User:Algorithm/

actionCreate), but is not implemented.

  1. The default option doesn't support {{CURRENTYEAR}} {{CURRENTMONTH}} {{CURRENTDAY2}}, and I assume there are others which

don't parse as well. (The prefix option would need this capability as well.)


Version: unspecified
Severity: normal

Details

Reference
bz6640

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:17 PM
bzimport set Reference to bz6640.

I don't understand what this means. Can you clarify? Please
include examples if possible.

robchur wrote:

It's a feature request; she wants us to add a couple of things.

  1. Prefix => An option which allows the value to be prepended to quietly
  2. Magic words => Better parser support within the "default" option (right now

we have hard-coded, hackish support for one word, as far as I know)

I was asked to implement these a little while ago, but I point blank refuse to
add more to that code until it is rewritten.

carl.duisberg wrote:

Add parameter prefix to Inputbox.php

This patch allows to specify parameter prefix to be specified in an inputbox.
It is passed as GET parameter of the createbox.

It is only a partial solution. Next thing to solve is make mediawiki to
understand this GET parameter.

Attached:

carl.duisberg wrote:

Add GET parameter prefix to Mediawiki

The content of GET parameter prefix will be prepended to the title.

Example:
/index.php?title=Page&prexix=MyTest
will be interpreted as
/index.php?title=MyTestPage

Attached:

webmaster wrote:

It looks like the CreateBox extension, which was based off Inputbox might already contain some of the code necessary. I think Inputbox is more widespread, however.

http://www.mediawiki.org/wiki/Extension:CreateBox

I think this feature request would be pretty handy as well.

@Rob, you are always awesome at making decent-code into great-code, would you consider rewriting this code to also include the two features Katie and I are requesting?

Also, would you prefer a new bug be opened for the re-write of the extension; once that is completed, this can then be implemented?

webmaster wrote:

Could someone please review Carl's attached patches?
Assuming they are up to snuff, could we implement them?

If not, as was mentioned before, I believe Algorithm has also implemented a (different) solution.
Worth reviewing, I figure...

webmaster wrote:

Separated issue #2 into Bug 12236.
(Issue #1 has patches attached for a proposed fix)

mike.lifeguard+bugs wrote:

(In reply to comment #2)

I was asked to implement these a little while ago, but I point blank refuse to
add more to that code until it is rewritten.

Does this still apply?

beesley wrote:

example of prefix not working: http://en.wikipedia.org/w/index.php?title=User:Angela/Sandbox&oldid=272207059

It does on Wikia and is a very useful feature.

beesley wrote:

I'd say this no longer applies and that createbox should be installed instead.

Adding prefix options to things in InputBox other than the search form wouldn't be hard if someone's willing to write up a patch (the code's a lot nicer since it was refactored a year-ish ago), the one above is entirely too outdated. It already looks for a 'prefix' option anyway (used by the search type), so it would be trivial to repurpose it for type=create.

CreateBox lacks a lot of the versatility in InputBox, so I'd like to see this fixed :)

happy.melon.wiki wrote:

The implementation proposed is not at all sensible; it will horribly break prefix searching as well as being hackish. A proper implementation will not touch core code.

Wikia's interface works in two stages: first it makes a call to index.php?action=create&title=Bar&prefix=Foo/&... which is 301-redirected to index.php?action=create&title=Foo/Bar&... somewhere within the handler for action=create. That is the best way of implementing this functionality without hacking at the core.

happy.melon.wiki wrote:

Fixed in r63922.