Page MenuHomePhabricator

Allow wikilinks in boilerplate page
Closed, ResolvedPublic

Description

Author: bugzilla.mediawiki

Description:
in the code :

				if( !isset( $row1[ 1 ] ) ) return true; // Invalid syntax, abort.

+ $row1[1]=ereg_replace('^\[\[','',$row1[1]);
+ $row1[1]=ereg_replace('\]\]$','',$row1[1]);

				$selected = false;

this allows to use wikilinks to the pages used, to be able to access them directly (and edit them) from the multiboilerplate page


Version: master
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:13 AM
bzimport set Reference to bz41787.

Hi,

noticed the bug tracking software was changed, but submitter information (and thus notifications) got lost (just as for https://phabricator.wikimedia.org/T43788)

unfortunately no way to change author (was not imported), so here the info that I submitted the issue -please contact me in case of questions

Patch against version 2.1.0 with preg_replace instead of ereg_replace (deprecated)

`
@@ -79,6 +79,8 @@ class MultiBoilerplateHooks {
if ( !isset( $rowParts[ 1 ] ) ) {
return true; // Invalid syntax, abort
}
+ $rowParts[1]=preg_replace('/^\[\[/','',$rowParts[1]);
+ $rowParts[1]=preg_replace('/\]\]$/','',$rowParts[1]);

$selected = false;
if ( $request->getVal( 'boilerplate' ) === $rowParts[ 1 ] ) {
$selected = true;
`

noticed the bug tracking software was changed, but submitter information (and thus notifications) got lost (just as for https://phabricator.wikimedia.org/T43788)

@Jhf2442: Submitters were contacted numerous times to please claim their contributions. See https://www.mediawiki.org/wiki/Phabricator/Help/Reclaim_Bugzilla_and_RT_accounts for information how to do that.

unfortunately no way to change author (was not imported)

If you are the author, you can claim your previous Bugzilla activity in Phabricator (see above) and it will be merged at some point.

Patch against version 2.1.0 with preg_replace instead of ereg_replace (deprecated)

Thanks for taking a look at the code!
You are very welcome to use developer access to submit this as a Git branch directly into Gerrit which makes it easier to review it quickly.
If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again!

@Jhf2442: I'd like to move away from a wiki content model eventually and to cut out all this regex, but in the meantime, this is probably a good idea (even though it's not a use case of mine). I'll try to test and add it soon. Thanks!

@Aklapper : done using patch loader, hope it worked fine
@FreedomFighterSparrow : can you elaborate on where you want to go ? Config through something like LocalSettings.php ?

@Jhf2442: I'll look at this now and merge.

The direction I want to take the extension is away from directly editing [[MediaWiki:Multiboilerplates]]; I want to use [[Special:Boilerplates]] as the editing interface, and save the configuration as json into [[MediaWiki:Multiboilerplates]]. This will allow us to stop using regular expressions for everything, which is just ugly and breakes easily.

@Aklapper : done using patch loader, hope it worked fine

Please provide a link to your patch. Thanks!

@Aklapper : sorry, thought you'd get a notification from gerrit :-(

Gerrit won't magically know who asked you where about that patch, but you can let it know. :) In any case, thanks!

Change 260516 had a related patch set uploaded (by Aklapper):
Allow wikilinks in template names

https://gerrit.wikimedia.org/r/260516

@Jhf2442, I uploaded a new changeset (somehow Gerrit hasn't notified Phabricator yet):

  • The same change had to be applied for the special page, otherwise it broke (yes, code duplication is evil and should be remedied)
  • I cleaned up the code in that part ("$things", really? talk about descriptive names)
  • I documented the option in the README and the new version in the CHANGELOG (trying to set a good example in documenting stuff)
  • I added your nick as an author/contributor. If you prefer a different wording for your credit, upload a new changset or let me know and I'll do that.

@Jhf2442, I uploaded a new changeset (somehow Gerrit hasn't notified Phabricator yet):

It won't. :) The one notification for readers of the task was T43787#1900881.

@Jhf2442, mind doing a quick review of my changeset? It'd be nice if I don't just self-merge things all the time, and besides, this is just small change upon your work.

Change 260516 merged by FreedomFighterSparrow:
Allow wikilinks in template names

https://gerrit.wikimedia.org/r/260516

FreedomFighterSparrow claimed this task.

Resolved with the merge of 260516.