PHP notice

Trying to get property of non-object

C:\xampp\htdocs\limesurvey250\application\controllers\admin\templates.php(52)

40     *
41     * @access public
42     * @param string $templatename
43     * @return void
44     */
45     public function templatezip($templatename)
46     {
47         global $oEditedTemplate;
48         if (!Permission::model()->hasGlobalPermission('templates','export'))
49         {
50             die('No permission');
51         }
52         $templatedir = $oEditedTemplate->viewPath . DIRECTORY_SEPARATOR;
53         $tempdir = Yii::app()->getConfig('tempdir');
54 
55         $zipfile = "$tempdir/$templatename.zip";
56         Yii::app()->loadLibrary('admin.pclzip');
57         $zip = new PclZip($zipfile);
58         $zip->create($templatedir, PCLZIP_OPT_REMOVE_PATH, $oEditedTemplate->viewPath);
59 
60         if (is_file($zipfile)) {
61             // Send the file for download!
62             header("Pragma: public");
63             header("Expires: 0");
64             header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

Stack Trace

#2
+
 C:\xampp\htdocs\limesurvey250\application\core\Survey_Common_Action.php(101): CAction->runWithParamsInternal(templates, ReflectionMethod, array("templatename" => "default", "sa" => "templatezip"))
096             $oMethod = new ReflectionMethod($this, $sDefault);
097         }
098 
099         // We're all good to go, let's execute it
100         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
101         return parent::runWithParamsInternal($this, $oMethod, $params);
102     }
103 
104     /**
105     * Some functions have different parameters, which are just an alias of the
106     * usual parameters we're getting in the url. This function just populates
#3
+
 C:\xampp\htdocs\limesurvey250\application\controllers\admin\templates.php(33): Survey_Common_Action->runWithParams(array("templatename" => "default", "sa" => "templatezip"))
28     {
29         if (!Permission::model()->hasGlobalPermission('templates','read'))
30         {
31             die('No permission');
32         }
33         parent::runWithParams($params);
34     }
35 
36 
37 
38     /**
#7
+
 C:\xampp\htdocs\limesurvey250\application\controllers\AdminController.php(164): CController->run("templates")
159                     $this->redirect(array('/admin/authentication/sa/login'));
160                 }
161 
162             }
163 
164             return parent::run($action);
165     }
166 
167     /**
168     * Routes all the actions to their respective places
169     *
2016-02-29 21:25:14 Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.19 Yii Framework/1.1.17