Yaron Koren has uploaded a new change for review.

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

Change subject: Fix for #default_form when form does not exist
......................................................................

Fix for #default_form when form does not exist

Change-Id: I8a8d25c0b37532da853237bd29c71a4ae03280a9
---
M includes/SF_ParserFunctions.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/38/173238/1

diff --git a/includes/SF_ParserFunctions.php b/includes/SF_ParserFunctions.php
index cc31967..5573f2b 100644
--- a/includes/SF_ParserFunctions.php
+++ b/includes/SF_ParserFunctions.php
@@ -186,6 +186,9 @@
                // Display information on the page, if this is a category.
                if ( $curTitle->getNamespace() == NS_CATEGORY ) {
                        $defaultFormPage = Title::makeTitleSafe( SF_NS_FORM, 
$defaultForm );
+                       if ( $defaultFormPage == null ) {
+                               return '<div class="error">Error: No form found 
with name "' . $defaultForm . '".</div>';
+                       }
                        $defaultFormPageText = 
$defaultFormPage->getPrefixedText();
                        $defaultFormPageLink = 
"[[$defaultFormPageText|$defaultForm]]";
                        $text = wfMessage( 'sf_category_hasdefaultform', 
$defaultFormPageLink )->text();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a8d25c0b37532da853237bd29c71a4ae03280a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to