Merge "API: Use message-per-value for apihelp-query+alllinks-param-prop"
[lhc/web/wiklou.git] / includes / api / ApiEditPage.php
index e70b8f0..2f1c01c 100644 (file)
@@ -35,6 +35,8 @@
  */
 class ApiEditPage extends ApiBase {
        public function execute() {
+               $this->useTransactionalTimeLimit();
+
                $user = $this->getUser();
                $params = $this->extractRequestParams();
 
@@ -96,9 +98,11 @@ class ApiEditPage extends ApiBase {
                        $contentHandler = ContentHandler::getForModelID( $params['contentmodel'] );
                }
 
+               $name = $titleObj->getPrefixedDBkey();
+               $model = $contentHandler->getModelID();
                if ( $contentHandler->supportsDirectApiEditing() === false ) {
                        $this->dieUsage(
-                               'Direct editing via API is not supported for this content type.',
+                               "Direct editing via API is not supported for content model $model used by $name",
                                'no-direct-editing'
                        );
                }
@@ -110,8 +114,6 @@ class ApiEditPage extends ApiBase {
                $contentFormat = $params['contentformat'];
 
                if ( !$contentHandler->isSupportedFormat( $contentFormat ) ) {
-                       $name = $titleObj->getPrefixedDBkey();
-                       $model = $contentHandler->getModelID();
 
                        $this->dieUsage( "The requested format $contentFormat is not supported for content model " .
                                " $model used by $name", 'badformat' );