Remove getVar call, access protected property in same class directly
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 19 Sep 2023 00:26:50 +0000 (12:26 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 19 Sep 2023 00:27:20 +0000 (12:27 +1200)
CRM/Campaign/Form/Survey.php

index a15aa03dea9a6b36ebe863d6c94802f616c99efc..e06367831d008dbc9486b50f1e61f6de8612a15e 100644 (file)
@@ -168,15 +168,13 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form {
   /**
    * @return string
    */
-  public function getTemplateFileName() {
-    if ($this->controller->getPrint() || $this->getVar('_surveyId') <= 0) {
+  public function getTemplateFileName(): string {
+    if ($this->_surveyId <= 0 || $this->controller->getPrint()) {
       return parent::getTemplateFileName();
     }
-    else {
-      // hack lets suppress the form rendering for now
-      self::$_template->assign('isForm', FALSE);
-      return 'CRM/Campaign/Form/Survey/Tab.tpl';
-    }
+    // hack lets suppress the form rendering for now
+    self::$_template->assign('isForm', FALSE);
+    return 'CRM/Campaign/Form/Survey/Tab.tpl';
   }
 
 }