Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/206765

Change subject: Remove throws from Title::getContentModel()
......................................................................

Remove throws from Title::getContentModel()

ContentHandler::getDefaultModelFor() always returns a contentmodel,
so this exception is never thrown.

Change-Id: I7678964f229da8fcd15eb49e9e8c8e9a258e35a1
---
M includes/Title.php
1 file changed, 0 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/65/206765/1

diff --git a/includes/Title.php b/includes/Title.php
index b0df15f..7e2b39e 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -940,7 +940,6 @@
        /**
         * Get the page's content model id, see the CONTENT_MODEL_XXX constants.
         *
-        * @throws MWException
         * @param int $flags A bit field; may be Title::GAID_FOR_UPDATE to 
select for update
         * @return string Content model id
         */
@@ -953,10 +952,6 @@
 
                if ( !$this->mContentModel ) {
                        $this->mContentModel = 
ContentHandler::getDefaultModelFor( $this );
-               }
-
-               if ( !$this->mContentModel ) {
-                       throw new MWException( 'Failed to determine content 
model!' );
                }
 
                return $this->mContentModel;

-- 
To view, visit https://gerrit.wikimedia.org/r/206765
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7678964f229da8fcd15eb49e9e8c8e9a258e35a1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.wel...@t-online.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to