In the beginning, there was Article.php. And the Article class had methods like Article::view(), Article::delete(), Article::protect(), etc. And the fundamental codeflow of Mediawiki consisted of something along the lines of:
$article = new Article( $title ); $action = wfGetTheActionSomehow(); $article->$action();
Over time Article has grown and bloated to become our third largest class (after ZhConversion and Parser). Several of its action methods have been spun out to separate files (EditPage.php, ProtectionForm.php and HistoryPage.php, among others). It's long overdue that this process be carried through to its natural conclusion with all action methods spun out into some new structure.
There are essentially two competing possibilities for structuring this, and they reflect the two parallel systems we have for "doing things other than viewing" to a wiki. One is action parameters, and the other is special pages. We have action=edit, or Special:MovePage, for instance; they have a similar function but different structure. We have action=delete to get rid of stuff, but then Special:Undelete to bring it back again. Special:Whatlinkshere and action=history are another pair of pages which have very similar principles (getting data that relates to a given page) but different implementations.
For either case in the backend I would think we'd want to create an ActionPage base class and an EditActionPage from that, which looks internally rather like a SpecialPage construct, might even subclass it. I'd like to ask people's opinions about which they think would work better in the frontend for, say, editing or protecting. If people think it would be better as a special page we'd make http://foo.example.com/w/index.php?title=Bar&action=edit a hard redirect to Special:Edit/Bar; that has the significant advantage of being able to be formed as an internal link. Conversely if we'd like to keep it an action it would make sense to redirect Special:MovePage/Bar back to ?title=Bar&action=move. Or is something more exotic like [[Action:Edit/Bar]] a possibility?
Thoughts?
--HM
On 04/04/2011 11:28 PM, Happy-melon wrote:
For either case in the backend I would think we'd want to create an ActionPage base class and an EditActionPage from that, which looks internally rather like a SpecialPage construct, might even subclass it.
We had this discussion in January. That's basically what I suggested, but there are some complications.
http://lists.wikimedia.org/pipermail/wikitech-l/2011-January/051041.html
-- Tim Starling
On Mon, Apr 4, 2011 at 9:28 AM, Happy-melon happy-melon@live.com wrote:
If people think it would be better as a special page we'd make http://foo.example.com/w/index.php?title=Bar&action=edit a hard redirect to Special:Edit/Bar; that has the significant advantage of being able to be formed as an internal link.
I've always thought this was the best way to do things. Be careful about overusing short URLs, though -- the only reason robots don't spider /w/index.php?title=Foo&action=edit right now is because it starts with /w/ instead of /wiki/.
Aryeh Gregor wrote:
On Mon, Apr 4, 2011 at 9:28 AM, Happy-melon happy-melon@live.com wrote:
If people think it would be better as a special page we'd make http://foo.example.com/w/index.php?title=Bar&action=edit a hard redirect to Special:Edit/Bar; that has the significant advantage of being able to be formed as an internal link.
I've always thought this was the best way to do things. Be careful about overusing short URLs, though -- the only reason robots don't spider /w/index.php?title=Foo&action=edit right now is because it starts with /w/ instead of /wiki/.
I can't think of a reason that any of the Special namespace needs to be indexed. Most of it is already marked noindex in the meta tags, as far as I remember. Additional explicit exclusion in a robots.txt file is always a good idea, though. Some auto-generation of a robots.txt file might be nice (WordPress does this). It's easy enough to exclude based on the prefix "Special:", but it's the localizations that ruin everything.
MZMcBride
On 11-04-04 08:12 PM, MZMcBride wrote:
Aryeh Gregor wrote:
On Mon, Apr 4, 2011 at 9:28 AM, Happy-melonhappy-melon@live.com wrote:
If people think it would be better as a special page we'd make http://foo.example.com/w/index.php?title=Bar&action=edit a hard redirect to Special:Edit/Bar; that has the significant advantage of being able to be formed as an internal link.
I've always thought this was the best way to do things. Be careful about overusing short URLs, though -- the only reason robots don't spider /w/index.php?title=Foo&action=edit right now is because it starts with /w/ instead of /wiki/.
I can't think of a reason that any of the Special namespace needs to be indexed. Most of it is already marked noindex in the meta tags, as far as I remember. Additional explicit exclusion in a robots.txt file is always a good idea, though. Some auto-generation of a robots.txt file might be nice (WordPress does this). It's easy enough to exclude based on the prefix "Special:", but it's the localizations that ruin everything.
MZMcBride
I don't really think that's a good reason to preclude being able to create special page based content. Eg: A forum extension that uses special pages. Our own Special:Code, etc... if we chose to allow those to be indexed.
Side note, why don't we allow indexing of Allpages? That sounds like a sane way for Google to find all the pages on a small growing wiki that hasn't setup the best linking yet or generated an xml sitemap.
What "IS" so evil about actions? Besides the implementation details which are just that... something we can make better. In fact something we could potentially make work better than SpecialPages would in this context. Personally, I like tacking on ?action=edit and especially purge. Prefixing Special:Edit/ doesn't sound nice to me. I know I fixed the issues with things like Special:Movepage not sharing the same UI tabs as the rest of the actions.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
Daniel Friesen wrote:
What "IS" so evil about actions? Besides the implementation details which are just that... something we can make better. In fact something we could potentially make work better than SpecialPages would in this context. Personally, I like tacking on ?action=edit and especially purge. Prefixing Special:Edit/ doesn't sound nice to me. I know I fixed the issues with things like Special:Movepage not sharing the same UI tabs as the rest of the actions.
I tack on purge/edit parameters fairly often as well. The biggest issue with parameters versus Special pages is that one is easily internally linkable currently (minus the pl_title restriction) and the other is not. There are _countless_ uses of <span class="plainlinks">[{{fullurl:foo|action=edit}} bar]</span> right now which is unacceptably ugly. There needs to be a cleaner syntax, particularly for edit links, but for most other actions as well. Personally, I don't really care what syntax is chosen, it just needs to be consistent.
MZMcBride
On Tue, Apr 5, 2011 at 4:41 AM, Daniel Friesen lists@nadir-seen-fire.com wrote:
Personally, I like tacking on ?action=edit and especially purge. Prefixing Special:Edit/ doesn't sound nice to me. I know I fixed the issues with things like Special:Movepage not sharing the same UI tabs as the rest of the actions.
I'm +1 with you on this. I don't have any convincing arguments against either way, but action links just look nicer to me.
Bryan
"Bryan Tong Minh" bryan.tongminh@gmail.com wrote in message news:BANLkTimhwb5EZR=5TPWSh8M34C4GvGXbXg@mail.gmail.com...
On Tue, Apr 5, 2011 at 4:41 AM, Daniel Friesen lists@nadir-seen-fire.com wrote:
Personally, I like tacking on ?action=edit and especially purge. Prefixing Special:Edit/ doesn't sound nice to me. I know I fixed the issues with things like Special:Movepage not sharing the same UI tabs as the rest of the actions.
I'm +1 with you on this. I don't have any convincing arguments against either way, but action links just look nicer to me.
Bryan
I agree that there aren't really killer arguments in either direction. But I *would* say that consistency is a virtue we should strive towards. I want *either* Special:Move/Foo and Special:Edit/Foo, *or* Foo&action=edit and Foo&action=move. There really is no justification for that discrepancy apart from "it's always been that way"... and that's what B/C is for.
--HM
Op 5 apr 2011, om 10:31 heeft Bryan Tong Minh het volgende geschreven:
On Tue, Apr 5, 2011 at 4:41 AM, Daniel Friesen lists@nadir-seen-fire.com wrote:
Personally, I like tacking on ?action=edit and especially purge. Prefixing Special:Edit/ doesn't sound nice to me. I know I fixed the issues with things like Special:Movepage not sharing the same UI tabs as the rest of the actions.
I'm +1 with you on this. I don't have any convincing arguments against either way, but action links just look nicer to me.
Without a doubt I'm +1 on this as well (either one of the other).
I'm in favour of action=.
* Easier to append to a url (like Daniel mentioned)
* "title" will actually be the title of the article and not of the special page (imho an important point, especially for gadgets. I dont even wanna remember how I had to solve the problem to use css/js on a particular 'title' and had to extract it from page name and split by slash for it to apply to MovePage as well. brrr)
* wgActionPaths are cool - /wiki/edit/Foo /wiki/Special:Move/Foo ? eh... no.
* because the action parameter is one of the oldest parameters around (feelin' nostaligic anyone ?)
* SpecialPages (imho) are not supposed to be bound to 1 title in particular (unlike MovePage and Undelete currently do).
Just my 2cents,
-- Krinkle
Krinkle wrote:
Op 5 apr 2011, om 10:31 heeft Bryan Tong Minh het volgende geschreven:
On Tue, Apr 5, 2011 at 4:41 AM, Daniel Friesen lists@nadir-seen-fire.com wrote:
Personally, I like tacking on ?action=edit and especially purge. Prefixing Special:Edit/ doesn't sound nice to me. I know I fixed the issues with things like Special:Movepage not sharing the same UI tabs as the rest of the actions.
I'm +1 with you on this. I don't have any convincing arguments against either way, but action links just look nicer to me.
Without a doubt I'm +1 on this as well (either one of the other).
I mostly agree with you, I think, but you seem to be side-stepping the linking issue. The fact that it's currently quite ugly to make an edit link or a protect link is one of the biggest arguments in favor of using Special pages.
Assuming all actions were standardized to use the ?action= parameter, what do you think about an {{#action:}} parser function? It would allow for something like [[{{#action:move|Main Page}}]]. Does this seem reasonable? If so, I think a page on MediaWiki with some transition information and a more in-depth look at what's actually needed to get to a consistent state would be a good next step (assuming such a page doesn't exist already). Thoughts?
MZMcBride
Op 8 apr 2011, om 01:11 heeft MZMcBride het volgende geschreven:
Krinkle wrote:
Op 5 apr 2011, om 10:31 heeft Bryan Tong Minh het volgende geschreven:
On Tue, Apr 5, 2011 at 4:41 AM, Daniel Friesen lists@nadir-seen-fire.com wrote:
Personally, I like tacking on ?action=edit and especially purge. Prefixing Special:Edit/ doesn't sound nice to me. I know I fixed the issues with things like Special:Movepage not sharing the same UI tabs as the rest of the actions.
I'm +1 with you on this. I don't have any convincing arguments against either way, but action links just look nicer to me.
Without a doubt I'm +1 on this as well (either one of the other).
I mostly agree with you, I think, but you seem to be side-stepping the linking issue. The fact that it's currently quite ugly to make an edit link or a protect link is one of the biggest arguments in favor of using Special pages.
Assuming all actions were standardized to use the ?action= parameter, what do you think about an {{#action:}} parser function? It would allow for something like [[{{#action:move|Main Page}}]]. Does this seem reasonable? If so, I think a page on MediaWiki with some transition information and a more in-depth look at what's actually needed to get to a consistent state would be a good next step (assuming such a page doesn't exist already). Thoughts?
MZMcBride
Indeed, the linking issue is one of the things action-parameters does not fix. But like you say, those could be solved in another way.
I like the {{#action}} idea. I'm not sure [[ and ]] can or should still be needed though.
-- Krinkle
On Thu, Apr 7, 2011 at 19:39, Krinkle krinklemail@gmail.com wrote:
Op 8 apr 2011, om 01:11 heeft MZMcBride het volgende geschreven:
I mostly agree with you, I think, but you seem to be side-stepping the linking issue. The fact that it's currently quite ugly to make an edit link or a protect link is one of the biggest arguments in favor of using Special pages.
Assuming all actions were standardized to use the ?action= parameter, what do you think about an {{#action:}} parser function? It would allow for something like [[{{#action:move|Main Page}}]]. Does this seem reasonable? If so, I think a page on MediaWiki with some transition information and a more in-depth look at what's actually needed to get to a consistent state would be a good next step (assuming such a page doesn't exist already). Thoughts?
MZMcBride
Indeed, the linking issue is one of the things action-parameters does not fix. But like you say, those could be solved in another way.
I like the {{#action}} idea. I'm not sure [[ and ]] can or should still be needed though.
-- Krinkle
This reminds me of Bug 14892 (Allow external links in edit summary and log reason): https://bugzilla.wikimedia.org/show_bug.cgi?id=14892
I also think it's cleaner to make move an action than edit a Special page.
Come to think of it, it is probably even cleaner not to have any default action. &action=view is pretty clean IMO, cleaner than having view as the only special case where no action or special page is needed. Conceptually it is just another action.
On Sat, Apr 9, 2011 at 1:36 AM, Platonides Platonides@gmail.com wrote:
I also think it's cleaner to make move an action than edit a Special page.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org