On Sun, Apr 28, 2019 at 10:03 PM Bryan Davis <bd...@wikimedia.org> wrote:

> On Sun, Apr 28, 2019 at 5:02 PM Huji Lee <huji.h...@gmail.com> wrote:
> >
> > Hi all,
> > Is there an API call that would allow you to retrieve the edit notice
> for a
> > page?
>
> I did not find a specific Action API that does this, but the edit
> notices themselves are found at predictable URLs per
> <https://www.mediawiki.org/wiki/Manual:Interface/Edit_notice>:
> * MediaWiki:Editnotice-<N> (where N is the namespace id)
> * MediaWiki:Editnotice-<N>-<Title> (where any '/' in the title is
> replaced with '-')
>
> You could also find all editnotice messages for a wiki using a prefix
> search generator:
>

This is your best bet. Note that, in namespaces with subpages, a page at
"Project:Foo/Bar/Baz" would display any editnotices at
MediaWiki:Editnotice-4-Foo and MediaWiki:Editnotice-4-Foo-Bar in addition
to MediaWiki:Editnotice-4-Foo-Bar-Baz.

There's also the 'TitleGetEditNotices' hook, which extensions can use to
add arbitrary other messages as edit notices. For example, GlobalUserPage
uses this to add a notice when editing the page used as a global user page
for a user, and TitleBlacklist uses it to add a notice when the tboverride
right is allowing the user to create/edit a blacklisted page.

There's also https://phabricator.wikimedia.org/T45683 about this question.


BTW, some incidental history: The per-page edit notices were removed in
2009 (r48276 <https://www.mediawiki.org/wiki/Special:Code/MediaWiki/48276>),
but for some unspecified reason only for namespaces without subpages, and
those were added back in 2011 (r97686
<https://www.mediawiki.org/wiki/Special:Code/MediaWiki/97686>) because the
inconsistency was seen as a bug rather than an incomplete removal. That
removal is why enwiki doesn't use the MediaWiki:Editnotice-<N>-<Title>
style notices, instead having every MediaWiki:Editnotice-<N> invoke a
template that transcludes subpages of Template:Editnotices/
<https://en.wikipedia.org/wiki/Special:PrefixIndex/Template:Editnotices/>
(plus that system has evolved to become a bit more flexible).

-- 
Brad Jorsch (Anomie)
Senior Software Engineer
Wikimedia Foundation
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to