aboutsummaryrefslogtreecommitdiffstats
path: root/includes/libs/filebackend/FileBackend.php
diff options
context:
space:
mode:
authorDaimona Eaytoy <daimona.wiki@gmail.com>2021-10-12 14:42:16 +0200
committerDaimona Eaytoy <daimona.wiki@gmail.com>2021-11-18 01:41:51 +0100
commitb77ae63e483d65819a11d54d6e4e2e37f0123034 (patch)
tree0f96ef68c4e34e8a208bd8e1bf2006b07d396d4b /includes/libs/filebackend/FileBackend.php
parentbfad87aae8438a536800ff720acb280ffb303200 (diff)
downloadmediawikicore-b77ae63e483d65819a11d54d6e4e2e37f0123034.tar.gz
mediawikicore-b77ae63e483d65819a11d54d6e4e2e37f0123034.zip
Use DeletePage in FileDeleteForm and fix output of ApiDelete
- Use DeletePage in FileDeleteForm instead of WikiPage::doDeleteArticleReal - Properly handle scheduled deletions in FileDeleteForm: previously, a null status value could indicate a missing page OR a scheduled deletion, but the code always assumed the first, and it would generate a duplicated log entry. The API response would also not contain the "delete-scheduled" message. This has been broken since the introduction of scheduled deletion. - In ApiDelete, for file deletions, check whether the status is OK not good. The two might be equivalent, but this way it's more consistent. - Add some documentation for the Status objects returned by file-related methods. This is still incomplete, as there are many methods using Status and none of them says what the status could be. In particular, this means that for now we keep checking whether the status is OK instead of good, even though it's unclear what could produce a non-fatal error. - In LocalFileDeleteBatch, avoid using a class property for the returned status, as that's hard to follow. Instead, use a local variable and pass it around when needed. Bug: T288758 Change-Id: I22d60c05bdd4a3ea531e63dbb9e49efc36935137
Diffstat (limited to 'includes/libs/filebackend/FileBackend.php')
-rw-r--r--includes/libs/filebackend/FileBackend.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/libs/filebackend/FileBackend.php b/includes/libs/filebackend/FileBackend.php
index 531b778a8690..5e2a21ccef58 100644
--- a/includes/libs/filebackend/FileBackend.php
+++ b/includes/libs/filebackend/FileBackend.php
@@ -861,7 +861,7 @@ abstract class FileBackend implements LoggerAwareInterface {
* - noAccess : try to deny file access (since 1.20)
* - noListing : try to deny file listing (since 1.20)
* - bypassReadOnly : allow writes in read-only mode (since 1.20)
- * @return StatusValue
+ * @return StatusValue Good status without value for success, fatal otherwise.
*/
final public function prepare( array $params ) {
if ( empty( $params['bypassReadOnly'] ) && $this->isReadOnly() ) {
@@ -875,7 +875,7 @@ abstract class FileBackend implements LoggerAwareInterface {
/**
* @see FileBackend::prepare()
* @param array $params
- * @return StatusValue
+ * @return StatusValue Good status without value for success, fatal otherwise.
*/
abstract protected function doPrepare( array $params );