X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FTitle.php;h=038e8b1b20288cf60a6feace353aaf60350d3311;hb=d6016fa1f985120829cfeb596571dd844da8b4e3;hp=59164e07e75c5d1e91d990971650d00eb4a10007;hpb=0eb72aca6028b4f2fb54c807b99ed17c3e1898d9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Title.php b/includes/Title.php index 59164e07e7..038e8b1b20 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2447,7 +2447,7 @@ class Title implements LinkTarget { # XXX: this might be better using restrictions if ( $action === 'patrol' ) { - return []; + return $errors; } if ( preg_match( '/^' . preg_quote( $user->getName(), '/' ) . '\//', $this->mTextform ) ) { @@ -4438,7 +4438,7 @@ class Title implements LinkTarget { * Get the oldest revision timestamp of this page * * @param int $flags Title::GAID_FOR_UPDATE - * @return string MW timestamp + * @return string|null MW timestamp */ public function getEarliestRevTime( $flags = 0 ) { $rev = $this->getFirstRevision( $flags ); @@ -4778,7 +4778,39 @@ class Title implements LinkTarget { } /** - * Get the default message text or false if the message doesn't exist + * Get the default (plain) message contents for an page that overrides an + * interface message key. + * + * Primary use cases: + * + * - Article: + * - Show default when viewing the page. The Article::getSubstituteContent + * method displays the default message content, instead of the + * 'noarticletext' placeholder message normally used. + * + * - EditPage: + * - Title of edit page. When creating an interface message override, + * the editor is told they are "Editing the page", instead of + * "Creating the page". (EditPage::setHeaders) + * - Edit notice. The 'translateinterface' edit notice is shown when creating + * or editing a an interface message override. (EditPage::showIntro) + * - Opening the editor. The contents of the localisation message are used + * as contents of the editor when creating a new page in the MediaWiki + * namespace. This simplifies the process for editors when "changing" + * an interface message by creating an override. (EditPage::getContentObject) + * - Showing a diff. The left-hand side of a diff when an editor is + * previewing their changes before saving the creation of a page in the + * MediaWiki namespace. (EditPage::showDiff) + * - Disallowing a save. When attempting to create a a MediaWiki-namespace + * page with the proposed content matching the interface message default, + * the save is rejected, the same way we disallow blank pages from being + * created. (EditPage::internalAttemptSave) + * + * - ApiEditPage: + * - Default content, when using the 'prepend' or 'append' feature. + * + * - SkinTemplate: + * - Label the create action as "Edit", if the page can be an override. * * @return string|bool */ @@ -4814,8 +4846,9 @@ class Title implements LinkTarget { $dbw = wfGetDB( DB_MASTER ); $dbw->onTransactionPreCommitOrIdle( - function () { - ResourceLoaderWikiModule::invalidateModuleCache( $this, null, null, wfWikiID() ); + function () use ( $dbw ) { + ResourceLoaderWikiModule::invalidateModuleCache( + $this, null, null, $dbw->getDomainId() ); }, __METHOD__ );