Yaron Koren has submitted this change and it was merged.

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(-)

Approvals:
  Yaron Koren: Checked; Looks good to me, approved



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: merged
Gerrit-Change-Id: I8a8d25c0b37532da853237bd29c71a4ae03280a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to