MWStew icon indicating copy to clipboard operation
MWStew copied to clipboard

Special page name should be capitalized in alias file

Open lokal-profil opened this issue 8 years ago • 5 comments

Closes #46

lokal-profil avatar May 27 '16 15:05 lokal-profil

The problem here is that special page name may have spaces in it. The builder, when it creates the class name, replaces any spaces with underscores, and adds 'Special' prefix.

If we need the same thing but without the 'Special' prefix, maybe we should add a getter for it for the special page -- and add it into the json structure for the twig file?

Also, whatever we change this too, I'm pretty sure it should be the same as the name we give the parent in the constructor in SpecialPage.php, so I think we'll need to use the same thing here https://github.com/mooeypoo/MWStew/blob/master/includes/twig/templates/specials/SpecialPage.php.twig#L10 ?

mooeypoo avatar May 27 '16 17:05 mooeypoo

Ok.

So per mw.org it should only be underscores which cause trouble. And additionally all lower causes the problem mentioned in #46.

And yes in addition to L10 I believe we should also use the same at https://github.com/mooeypoo/MWStew/blob/master/includes/twig/templates/specials/SpecialPage.php.twig#L3

lokal-profil avatar Jun 01 '16 09:06 lokal-profil

Yeah it seems like the only use for the "raw" .name is for the title of the special page. All other occurrences of the name should pass through some sanitizer - either to replace spaces with underscores, or remove spaces with CamelCase.

This means changing to add the new 'fixed' name variable to the builder and then use that one in the instance you used it + the two we discussed above.

Would you like to fix up this pull request and I'll merge it, or do you want me to?

mooeypoo avatar Jun 03 '16 01:06 mooeypoo

I can try to fix it, but I'm not sure when I'll get the opportunity. I also don't mind if you beat me to it.

lokal-profil avatar Jun 03 '16 08:06 lokal-profil

I'll try to get to it during the weekend!

mooeypoo avatar Jun 03 '16 17:06 mooeypoo