dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add SPARQL client to core"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiOptions.php
diff --git
a/includes/api/ApiOptions.php
b/includes/api/ApiOptions.php
index
14bd089
..
4b76906
100644
(file)
--- a/
includes/api/ApiOptions.php
+++ b/
includes/api/ApiOptions.php
@@
-1,9
+1,5
@@
<?php
/**
<?php
/**
- *
- *
- * Created on Apr 15, 2012
- *
* Copyright © 2012 Szymon Świerkosz beau@adres.pl
*
* This program is free software; you can redistribute it and/or modify
* Copyright © 2012 Szymon Świerkosz beau@adres.pl
*
* This program is free software; you can redistribute it and/or modify
@@
-24,6
+20,8
@@
* @file
*/
* @file
*/
+use MediaWiki\MediaWikiServices;
+
/**
* API module that facilitates the changing of user's preferences.
* Requires API write mode to be enabled.
/**
* API module that facilitates the changing of user's preferences.
* Requires API write mode to be enabled.
@@
-78,7
+76,8
@@
class ApiOptions extends ApiBase {
$this->dieWithError( 'apierror-nochanges' );
}
$this->dieWithError( 'apierror-nochanges' );
}
- $prefs = Preferences::getPreferences( $user, $this->getContext() );
+ $preferencesFactory = MediaWikiServices::getInstance()->getPreferencesFactory();
+ $prefs = $preferencesFactory->getFormDescriptor( $user, $this->getContext() );
$prefsKinds = $user->getOptionKinds( $this->getContext(), $changes );
$htmlForm = null;
$prefsKinds = $user->getOptionKinds( $this->getContext(), $changes );
$htmlForm = null;
@@
-121,7
+120,7
@@
class ApiOptions extends ApiBase {
$user->setOption( $key, $value );
$changed = true;
} else {
$user->setOption( $key, $value );
$changed = true;
} else {
- $this->addWarning( [ 'apiwarn-validationfailed', wfEscapeWiki
t
ext( $key ), $validation ] );
+ $this->addWarning( [ 'apiwarn-validationfailed', wfEscapeWiki
T
ext( $key ), $validation ] );
}
}
}
}