and error messages. It is available client-side via mw.config.get( 'wgRequestId' ).
The request ID supplants exception IDs. Accordingly, MWExceptionHandler::getLogId()
is deprecated.
+* (T33313) Add a preference for watching uploads by default, also applies
+ to API-based upload tools.
=== External library changes in 1.27 ===
'watchcreations' => 1,
'watchdefault' => 1,
'watchdeletion' => 0,
+ 'watchuploads' => 1,
'watchlistdays' => 3.0,
'watchlisthideanons' => 0,
'watchlisthidebots' => 0,
$watchTypes['rollback'] = 'watchrollback';
}
+ if ( $user->isAllowed( 'upload' ) ) {
+ $watchTypes['upload'] = 'watchuploads';
+ }
+
foreach ( $watchTypes as $action => $pref ) {
if ( $user->isAllowed( $action ) ) {
// Messages:
- // tog-watchdefault, tog-watchmoves, tog-watchdeletion, tog-watchcreations
+ // tog-watchdefault, tog-watchmoves, tog-watchdeletion, tog-watchcreations, tog-watchuploads
// tog-watchrollback
$defaultPreferences[$pref] = [
'type' => 'toggle',
/** @var $file File */
$file = $this->mUpload->getLocalFile();
- // For preferences mode, we want to watch if 'watchdefault' is set or
- // if the *file* doesn't exist and 'watchcreations' is set. But
- // getWatchlistValue()'s automatic handling checks if the *title*
- // exists or not, so we need to check both prefs manually.
+ // For preferences mode, we want to watch if 'watchdefault' is set,
+ // or if the *file* doesn't exist, and either 'watchuploads' or
+ // 'watchcreations' is set. But getWatchlistValue()'s automatic
+ // handling checks if the *title* exists or not, so we need to check
+ // all three preferences manually.
$watch = $this->getWatchlistValue(
$this->mParams['watchlist'], $file->getTitle(), 'watchdefault'
);
+
if ( !$watch && $this->mParams['watchlist'] == 'preferences' && !$file->exists() ) {
- $watch = $this->getWatchlistValue(
- $this->mParams['watchlist'], $file->getTitle(), 'watchcreations'
+ $watch = (
+ $this->getWatchlistValue( 'preferences', $file->getTitle(), 'watchuploads' ) ||
+ $this->getWatchlistValue( 'preferences', $file->getTitle(), 'watchcreations' )
);
}
return false;
} else {
// New page should get watched if that's our option.
- return $this->getUser()->getOption( 'watchcreations' );
+ return $this->getUser()->getOption( 'watchcreations' ) ||
+ $this->getUser()->getOption( 'watchuploads' );
}
}
"tog-watchdefault": "Add pages and files I edit to my watchlist",
"tog-watchmoves": "Add pages and files I move to my watchlist",
"tog-watchdeletion": "Add pages and files I delete to my watchlist",
+ "tog-watchuploads": "Add new files I upload to my watchlist",
"tog-watchrollback": "Add pages where I have performed a rollback to my watchlist",
"tog-minordefault": "Mark all edits minor by default",
"tog-previewontop": "Show preview before edit box",
"tog-watchdefault": "[[Special:Preferences]], tab 'Watchlist'. Offers user to add edited pages to watchlist. {{Gender}}",
"tog-watchmoves": "[[Special:Preferences]], tab 'Watchlist'. Offers user to add moved pages to watchlist. {{Gender}}",
"tog-watchdeletion": "[[Special:Preferences]], tab 'Watchlist'. Offers user to add deleted pages to watchlist. {{Gender}}",
+ "tog-watchuploads": "[[Special:Preferences]], tab 'Watchlist'. Offers user to add their uploaded files to watchlist. {{Gender}}",
"tog-watchrollback": "[[Special:Preferences]], tab 'Watchlist'. Offers user to add pages where the user has rollbacked an edit to watchlist. {{Gender}}\n\nSee also {{msg-mw|tog-watchdefault}}, {{msg-mw|tog-watchcreations}}.",
"tog-minordefault": "[[Special:Preferences]], tab 'Edit'. Offers user to mark all edits minor by default. {{Gender}}",
"tog-previewontop": "Toggle option used in [[Special:Preferences]]. {{Gender}}",