Adds two new hooks:
* AlternateEditPreview allows an extension to override the standard
page preview display.
* EditPage::showStandardInputs:options allows an extension to add
additional HTML to the end of the editOptions area of the edit form.
Change-Id: Ic5d35c8e9ff71282b5ebccc87c64894a385e5836
- allows extensions to perform some action at time that a undeletion log entry is performed,
or skip the insertion of a log entry.
Change-Id: I5b0caaddfe5d7262612a60946d9f5c4af2679141
We store various bits of data as "expando" properties on the Parser
object, to pass information from one stage of the parser to another. If
the parser is cloned, however, we can run into trouble because two
different Parser objects are now manipulating the same extension data
structure; this often shows up when ParserClearState is called on one
clone and clears the state of the other as well.
Since a deep clone might be too expensive and still might be wrong in
some cases, it seems most useful to simply provide a ParserCloned hook
so extensions can just do The Right Thing.
Change-Id: Ieec65c908d71e89b9a66f83b9a626f842aadacbb
This is needed to fix bug 41706 and similar, watch for follow-ups.
Automatic, implicit conversion may be handy in several cases, especially
for converting between different text based content models. E.g. it should
be possible to create a diff between a JavaScript and a wikitext page. This
change lais the foundations for this ability.
Change-Id: Ie7d87b67b24ac9897cb5696220a7785b228d3c79
Introducing ShowSearchHit hook into SpecialSearch, so extensions
can control of how search results are displayed. This does not
fix bug 41580, but it's a precondition to fixing it in Wikibase.
Change-Id: I9158684b92e320a486266c45dc3f7cf466ec5a24
ExportDemoTest::testExportDemo
xml not valid against xsd: DOMDocument::schemaValidate(): failed to
compile: Wrong escape sequence, misuse of character '\'
Change-Id: Iefae25270b0ad1bf3aa587a51eec3fec1866cff8
Add a assertion to the validation test to ensure, export-demo.xml is
updated next time, when a new version is created.
Change-Id: I004ca23d848dd6701acb45e9b755397b434370c4
Also add $context parameter to the hook and (bug 40845) don't
overwrite pageInfo's $title parameter.
Change-Id: I41128abb72553142b45e90befabde541b2d8941f
This introduces the ContentHandler facility into MediaWiki,
see docs/contenthandler.txt.
For convenient review, a squashed version is available at
https://gerrit.wikimedia.org/r/27191
The ContentHandler facility is a major building block of the Wikidata project.
It has been discussed repeatedly on wikitech-l.
Change-Id: I3804e2d5f6f59e6a39db80744bdf61bfe8c14f98
Called before final ob_end_flush() which will send the buffered output to the client. This allows for last-minute modification of the output within the buffer by using ob_get_clean().
- patch-set2: moved the hook before OutputPage::sendCacheControl() is called, as suggested by Reedy.
Change-Id: I264a37ac74e0c18ff141f82156e669ece3212c2d
Added new hook in ApiMain::checkCanExecute
so that extensions can authenticate and
authorize API clients before the module is
execute. (Necessary for extensions like
OAuth that externally authnz clients.)
Change-Id: I1b059fd9a4aa717928af8b09f5edebe899ab3ce1
Signed-off-by: Tyler Romeo <tylerromeo@gmail.com>
This hook lets you change the revision ID used for a page (a Title
object), when displaying that page in search results. It's useful for
the Approved Revs extension, so that pages whose approved revision is
not their latest can have their approved revision, not the latest one,
show up when doing a search text. It's also potentially useful for
other, similar extensions, like FlaggedRevs.
Change-Id: Ic4bad8dfaa83de131db9c8e7667d7f5767d8d5f5
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)
Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
The alignment of image thumbs should follow the page content language instead of the wiki content language.
For this it needs the parser context, and because it makes sense to have it as first parameter, I renamed makeImageLink2() to makeImageLink(), the 2 seemed to be redundant anyway.
The old function name keeps the old behaviour, but can be removed quite soon since almost no extension is using it.
Change-Id: I0c35b06a85528dcc43fdd0578dc9b327c495cf4a
I investigated the available parameters and considered which could be
plausibly useful for Special:MyPage and Special:MyTalk, and there are
quite a few. See inline documentation for a list of them. More could
potentially be added in the future if a use case is discovered.
This patch also make it possible for extensions to add their own
parameters to this list, through the new hook:
RedirectSpecialArticleRedirectParams
It has at least one application - with FlaggedRevs, it's desirable to
pass the "stable" flag through Special:MyPage. It also makes it simple
for individual servers that have some special reason to pass on a
particular parameter to do so in LocalSettings.php, simplifying
upgrades.
Change-Id: I3101fbe2eba8712b87a53706583f4e8f3e907478
This patch add the hook 'InternalParseBeforeSanitize' which gets called
during Parser's internalParse method just before the parser removes
unwanted/dangerous HTML tags.
Change-Id: If32053f9304088d7943aa0c9e78716a644c34fe1
In order to correctly output an error message that might contain
wikilinks, Cite.php needs a hook that is called after the page is parsed
but before the call to replaceLinkHolders().
Change-Id: Iaa2755f994edb081eb1d176f632f7add41640dbf
Meanwhile also:
- refactored reallyDoQuery in Pager.php, to make outside intervention possible
- extend reallyDoQuery in SpecialContributions.php, adding in the hook and composing the final results array based on the combined results of all queries added through the hook
Change-Id: Ifd63cdf1950f914a3fba1757a905385aca311eda
In formatRow(): the hook change breaks FlaggedRevs, and also $ret may not
always be defined. The patch could use some extra work.
This reverts commit 0944502d4c
This reverts commit d0131e8a19.
Change-Id: I05d980e19d99e1c461199705b04de9e307daa907
Meanwhile also:
- refactored reallyDoQuery in Pager.php, to make outside intervention possible
- extend reallyDoQuery in SpecialContributions.php, adding in the hook and composing the final results array based on the combined results of all queries added through the hook
- remain backwards compatible on method-level
- fix FakeResultWrapper::fetchRow, which (contrary to ResultWrapper::fetchRow) didn't always return an array
Change-Id: I74c3784d6d93b992d72f2db24cc29f30e458c1e3
Removed some spurious whitespace
Changed how wfRunHooks are used, and also the test for default formatting
Change-Id: I4c3fc1080f83166d7b89aeb9a1487e173e9ccb65
...after a discussion with Debian packagers. They can now override installer
classes and change LocalSettings.php the installer generates. The file
intended for such overrides, mw-config/overrides.php, has intentionally been
placed outside of includes to underline the "don't change includes" paradigm.
Change-Id: Id82b90f6740307609bc6c6f4fb8765bc3484dbe7
From bug description: "This is helpful for incremental dumps, to know if
there are revisions missing between the last full dump and this
incremental dump"
Change-Id: I772f976942a306ad573efc659d09714e8250f5ec
Added information about the properties of the results of API calls
to action=paraminfo, including information about "property groups":
what should the prop parameter be set to to get that property.
Uses the same format for types as parameters already do.
The output format of some modules doesn't fit this, so the result
properties for them weren't added, or only partially.
Partially implemented modules:
* expandtemplates:
parsetree is in its own tag
* protect, allusers, backlinks, deletedrevs, info, imageinfo,
logevents, querypage, recentchanges, revisions, searchinfo,
usercontribs, userinfo, users, watchlist, upload:
response with partially complex structure
Not implemented modules:
* feedcontributions, feedwatchlist, opensearch, rds:
non-standard reponse
* help:
error is normal response; not very useful for automated tools anyway
* paraminfo, parse, pageprops, siteinfo, userrights:
response with complex structure
Change-Id: Iff2a9bef79f994e73eef3062b4dd5461bff968ab
The xsd defines the <redirect> as string tag, but it is outputted with a
title attribute. To keep b/c with the dumps this patch changed the xsd
and not the export xml.
Change-Id: Iba77e19ce40768018e292a08997473b82bc263f8
This patch was made in December 2005 by Elvis Stansvik on bug 4220, you
will find below the rewritten introduction for his patch contribution.
"""
The XML Schema for the XML dump format used by MediaWiki has no
constraints for the page and revision identifiers. This patch solve that
issue by enforcing the constraint in the XSD.
It most probably makes sense, since I think that:
- some parsers capable of Schema validation can work more efficiently
if constraints are in the XSD.
- Another reason is that (however unlikely) some other software might
output files in this format are not obliged to keep the IDs unique,
according the the XSD in its current form.
"""
Updating the http://www.mediawiki.org/xml/export-0.7/ public URL is
tracked by bug 37111.
Change-Id: Idb82fe620c3395acaa8f051b4d4d0d770cd33d44
Representing content_model and content_format as integers in the
database was suggested by Asher mainly to save space.
This change entails some refactoring and renaming, but no big
change in logic.
This entails some refactoring to actually surface the log_id all the way
up:
* Made doDeleteArticleReal() return a Status object rather than a
constant, and put the log_id in $status->value. This Status object is
also passed to the ArticleDelete hook.
* Kept doDeleteArticle() the same for extension compatibility.
* Switched all core callers of doDeleteArticle() to
doDeleteArticleReal() and surfaced the error message from the Status
if appropriate, rather than hardcoding 'cannotdelete' all over the
place.
* Exposed the log_id in ApiDelete
* Add 'delete-hook-aborted' message for when a hook aborts the deletion
but does not provide an error message. Previously this just caused the
'cannotdelete' message to appear.
Change-Id: Ia6415b390d5d4172ce96667f46ccdba2be02461f
This adds a GitViewers hook to GitInfo, and slightly refactors the
$viewers variable to be called through a function so the hook can be
called. This is so extensions can add their own git repository viewer
to the Special:Version git sha field.
Change-Id: Ifc8396984de6a51be85fb63cd9754d57333bde03
to "wfShellWikiCmd". The old function now remains as a wrapper. The term "maintenance" is too restrictive.
Change-Id: I5c23d6475fd1aca374ee57b89212eee3a0d8cea1
Pretty narrow use case isn't very well defined, and this has *felt wrong* to me since
it was committed in November. Easier to pull for now rather than blocking release.
There are two extensions (InterwikiIntegration and Syslog) that use these hooks and they don't Article-only methods so they won't break by this change.
font-family: monospace, monospace;
Is elegant and has my preference :-)
font-family: monospace, DOESNOTEXISTREALLY;
Really make it obvious
follow r108123
Changed written by Timo and reviewed by Hashar. This should be harmless.
To enable the feature:
$wgEnableJavaScriptTest = true;
Then head to:
[[Special:JavaScriptTest/qunit]]
* mw.config is the new way, and global config variable lookups are deprecated
* Based on two phase3-wide quick searches:
-- of " wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=321&hash=81700bf7486e4fee3b7bc1f83eb9eba6
-- of "!wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=327&hash=47c9d54a7a1d5d58a724dd834585f40d
Related changes:
* Changed some php comments mentioning "wg" variables to include the dollar sign, and a typo when the wf function prefix was meant.
* Removed TODO comment in wikibits.js and made it use the JS equivalent of wfUrlencode, which we have now, mw.util.wikiUrlencode
* SpecialUpload.php: use OutputPage::addJsConfigVars instead of creating a new script tag through OutputPage::addScript(Skin::makeVariablesScript(..))
* Renamed wgUploadSetup in upload.js and made it local. Not used anywhere in ./trunk/phase3 and ./trunk/extensions
* Fix OutputPage::addJsConfigVars so that it can actually be called with an array instead of two arguments for key/value
* Some minor whitespace/convention stuff around the same line
This is the wrong configuration format for such a feature, and the wrong interface. We already have certain per-namespace permissions in the Title class, and we didn't need to add extra formal parameters to a whole lot of User methods in order to get them. The feature should be implemented wholly in Title, and the concept of user rights should remain relatively simple and easy to understand, and independent of its many applications, i.e. a user either has a right or doesn't. Rights are just a tool for developing access policies; the complexity should be in the caller.
The revert was mostly done by hand, since there were a lot of conflicts. I tried to preserve the gist of conflicting changes in r102187 and r102873. The test changes are not simple reverts, rather I just edited out the per-namespace tests. I reverted the followups r92589 and r104310.
* Moved original URL fetching code and parameter extraction code to thumb.php
* Made use of local repo URL and hash settings to avoid extra config code
* This makes it easy to add hooks for extensions/config to alter behavoir (ExtractThumbParameters hook added)
* Added FileRepo::getHashLevels()
* WikiPage::getParserOutput() requires a ParserOptions object (and optionally the revision ID) instead of an User object, removes an hidden dependency on $wgLang. For this reason, WikiPage::isParserCacheUsed() now also uses a ParserOptions object instead of an User object (doesn't change anything in the code except the variable name and it's not called in extensions)
* Moved PoolWorkArticleView to WikiPage.php and added an entry in the AutoLoader and moved output-related stuff directly in Article::view() so that in can be shared with WikiPage::getParserOutput() (removes code duplication, etc.)
* Added the revision ID to the PoolCounter key so that it knows which revision is being parsed and doesn't wait for another parse operation with same options but different revisions
* Removed Article::doViewParse(), Article::tryDirtyCache() and Article::getOutputFromWikitext() since they are now integrated in PoolWorkArticleView and Article::view() and there are no callers in extensions. This also fixes a bug since Article::doViewParse() will get another ParserOptions instance with special options set in Article::view() not be repercuted.
* Updated DifferenceEngine to use the new system
* Updated docs/memcached.txt to correct method names
* Moved $wgUploadMaintenance check after permissions and read only, so that the user doesn't think the error is temporary if he both doesn't have the permission and $wgUploadMaintenance is true
* Show normal error page when $wgUploadMaintenance and added a message for the error title
* Moved watchlist updating to FileDeletForm::execute(), it has nothing to do in doDelete() (would also be executed for api requests, etc.)
* Added $user parameter to FileDeletForm::doDelete() to pass the user doing the action
* Use WikiPage instead of Article
Add a UserDisplayName hook to allow extensions to give custom display names for users.
Add a $wgRealNameInInterface to use the real name of a user as the display name.
To start of the first use of the display name functionality tweak SkinTemplate to declare the userdisplayname and use it inside of personal_urls.
* When the user doesn't have permission to protect/unprotect the page, display a page with the title set to "View protection level for ...", then the permissions errors and the current protection levels. Except for the title, this was already the case for permissions errors, but when the database was read-only this was throwing an exception due to the change in OutputPage::readOnlyPage()
* Moved check for NS_MEDIAWIKI a level up, so that is it also catched on page save, and make the output in such case much more user friendly
* Changed edit token to be salted with array( 'protect', 'page name' ) (as for action=watch)
* Allow extensions to return false in ProtectionForm::save hook for consistency with other hooks and in that case fill the error message with 'hookaborted' if the extension does not provide an customised error message.
* Changed ProtectionForm::show() to accept an array of message name and its parameters in addition of a string with raw HTML and converted calls to use the new method. This also means that ProtectionForm::save can use this
* Removed the setSubtitle() call for the 'formerror' message in case of error since it's overriden by the "back link"
* Pass the File object in LocalFilePurgeThumbnails so handlers can use the getRel() functions and such
* Also added the hook to hooks.txt, as this could be useful for other caches or things in thumb_handler.php
entire recent changes line for user with 'Enhanced recent changes' option
It is equivalent to the existing hook OldChangesListRecentChangesLine
Reported by finlay on IRC.
WikimediaIncubator:
* use these hooks and SpecialSearchSetupEngine to improve search usability
* use a different message for the language code in preferences, per suggestion of Amir
* Introduce new hooks which allow BacklinkCache to handle non-core tables
* Make table name a parameter to RefreshLinks2 job (instead of hardcoded templatelinks)
- Allow extensions to hook into WebRequest::getPathInfo and add to or alter the way titles are extracted from paths
- Add a $variant argument to the GetLocalURL hook; It's always had $query, but never had $variant. As a result extensions using GetLocalURL never new if getLocalURL and have the possibility of trying to change the url in cases where they shouldn't and as a result breaking links on wiki with language variants.
- Add GetLocalURL::Internal hook for non-interwiki links. These kinds of links internally use a ugly hack for action=render and an extension using GetLocalURL can be buggy in render mode if they don't re-implement the same ugly hack that MW does. This ::Internal hook runs before the hack does so extension authors don't need to be exposed to our ugly hacky code.
- Add GetLocalURL::Article hook specifically for url tweaks to pretty urls (ie: Only when we would apply $wgArticlePath); This hook avoids the need for extensions that only want to tweak pretty url output. This hook avoids the need to make a bunch of tests for things like !$title->isExternal(), $query == '', and $variant === false which getLocalURL does and could potentially change in the future making wider GetLocalURL hooks change in function requiring extension updates.
* Document what happens as the result of each value returned
* Require boolean true to continue, not just a true value or strings
would succeed
* Trim the arguments since the header array already contains them.
FirePHP is an extension to Firebug, an awesome debugging extension to Firefox.
It allows pulling debug log data in from your PHP script via HTTP headers, which then get displayed in Firebug's console along with errors, warnings, and AJAX hits from the web page.
Added 'Debug' hook which gets called from wfDebug() and wfDebugLog() to take this; note that a few lines of output won't make it to FirePHP as they are output either before we've done all plugin initialization, or after we've flushed output and can no longer add HTTP headers.
BSD-licensed FirePHPCore library from firephp-libs commit aff25803a3ff460b2797:
https://github.com/cadorn/firephp-libs/blob/aff25803a3ff460b2797/packages/core/lib/FirePHPCore/FirePHP.class.php
There's not a lot of fancy integration; everything's just output as a 'log' line.
You can use $wgFirePHP global (or call FirePHP::getInstance() yourself) to get direct access to FirePHP's fancier features in test code.
* Encapsulate index.php in wfIndexMain() (similar to r77873)
* Kill $wgArticle check in Exception, not necessary anymore
* Kill $wgArticle in Setup, also not necessary
* Add angry note about $wgArticle to rebuildFileCache.
* Remove note about $wgArticle in Parser since it's dying anyway
Should be fully backwards compatible. Lightly tested, but only with MySQL search backend.
Introduces concept of search profiles, which replace long list of namespaces in the url.
Hope I did this in an ok fashion. svn merge --re-integrate was giving me issues
so I just essentially over-wrote my working copy with the version at img_metadata.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc). Create abstract base classes Action and FormlessAction to support these two cases. HTMLForm is an integral part of the form-based structure.
* Look mum, no globals! :D Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept. This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php. This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible. There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter. On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way. Update LiquidThreads to use these new hooks where appropriate.
other extensions by handling the 'AbortAutoAccount' hook, similar to the
'AbortNewAccount' triggered by explicit account creations. (They are separate
to avoid loops and confusion; auth plugins like CentralAuth need to handle
AbortNewAccount separately.
* Made FlaggedRevs specify files by sha1,timestamp to handle renames with no redirects. This makes them handled as well as templates in this regard. (bug 27836)
* Moved BeforeGalleryFindFile hook to proper place (don't trigger for non-NS_FILE titles)
* Removed unused mRevisionId field from ImageGallery
* Removed old hotfix from makeMediaLinkObj(); all the current callers would crash beforehand if the title was null anyway
* Updated hook docs (some prior params were missing)
* Broke some long lines and cleaned up some whitespace
* TODO: track file info in core rather than fr_fileSHA1Keys and ugly, duplicated, queries. This should be easy to do now.