Error

Call to a member function getImagenes() on null

/home/tigerovi/public_html/protected/controllers/front/SiteController.php(766)

754                 }
755             }
756         }
757 
758         echo 'fail';
759         die();
760     }
761 
762     public function actionDownloadFile() {
763         if (!empty($_GET['id'])) {
764             $idProducoto = (int) $_GET['id'];
765             $producto = CMSClass::getContenido($idProducoto);
766             $ficha = $producto->getImagenes('P');
767 
768             if (!empty($ficha)) {
769                 $path = YiiBase::getPathOfAlias('webroot') . '/upload/' . $ficha[0]->archivo;
770 
771                 if (!empty($path) && file_exists($path)) {
772                     header('Content-Description: File Transfer');
773                     header('Content-Type: application/octet-stream');
774                     header('Content-Disposition: attachment; filename=' . basename($path));
775                     header('Content-Transfer-Encoding: binary');
776                     header('Expires: 0');
777                     header('Cache-Control: must-revalidate');
778                     header('Pragma: public');

Stack Trace

#7
+
 /home/tigerovi/public_html/protected/components/WebApplicationEndBehavior.php(24): CApplication->run()
19         // Attach the changeModulePaths event handler
20         // and raise it.
21         $this->onModuleCreate = array($this, 'changeModulePaths');
22         $this->onModuleCreate(new CEvent($this->owner));
23 
24         $this->owner->run(); // Run application.
25     }
26 
27     // This event should be raised when CWebApplication
28     // or CWebModule instances are being initialized.
29     public function onModuleCreate($event) {
#9
+
 /home/tigerovi/public_html/index.php(15): CComponent->__call("runEnd", array("front"))
10 defined('YII_DEBUG') or define('YII_DEBUG', true);
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->runEnd('front');
2024-03-28 17:32:11 Apache Yii Framework/1.1.12