Ver código fonte

Ticket #2169 - Possible issue if View object cannot be created.

AntonLV 7 anos atrás
pai
commit
9ee9d09014

+ 4 - 2
modules/base/general/classes/BxBaseModGeneralPageEntry.php

@@ -54,8 +54,10 @@ class BxBaseModGeneralPageEntry extends BxTemplPage
 
         // count views
         $CNF = &$this->_oModule->_oConfig->CNF;
-        if (!empty($CNF['OBJECT_VIEWS'])) {
-            BxDolView::getObjectInstance($CNF['OBJECT_VIEWS'], $this->_aContentInfo[$CNF['FIELD_ID']])->doView();
+        if(!empty($CNF['OBJECT_VIEWS'])) {
+            $oView = BxDolView::getObjectInstance($CNF['OBJECT_VIEWS'], $this->_aContentInfo[$CNF['FIELD_ID']]);
+            if($oView && $oView->isEnabled())
+                $oView->doView();
         }
 
         // set cover image