PHP warning

count(): Parameter must be an array or an object that implements Countable

/var/www/u1302250/data/home/wb/waysbook/server/vendor/yiisoft/yii/framework/db/ar/CActiveFinder.php(1408)

1396 
1397     private function queryOneMany()
1398     {
1399         $relation=$this->relation;
1400         $model=$this->_finder->getModel($relation->className);
1401         $builder=$model->getCommandBuilder();
1402         $schema=$builder->getSchema();
1403         $table=$model->getTableSchema();
1404         $parent=$this->_parent;
1405         $pkTable=$parent->model->getTableSchema();
1406 
1407         $fks=preg_split('/\s*,\s*/',$relation->foreignKey,-1,PREG_SPLIT_NO_EMPTY);
1408         if(count($fks)!==count($pkTable->primaryKey))
1409             throw new CDbException(Yii::t('yii','The relation "{relation}" in active record class "{class}" is specified with an invalid foreign key. The columns in the key must match the primary keys of the table "{table}".',
1410                         array('{class}'=>get_class($parent->model), '{relation}'=>$relation->name, '{table}'=>$pkTable->name)));
1411 
1412         // set up mapping between fk and pk columns
1413         $map=array();  // pk=>fk
1414         foreach($fks as $i=>$fk)
1415         {
1416             if(!isset($table->columns[$fk]))
1417                 throw new CDbException(Yii::t('yii','The relation "{relation}" in active record class "{class}" is specified with an invalid foreign key "{key}". There is no such column in the table "{table}".',
1418                     array('{class}'=>get_class($parent->model), '{relation}'=>$relation->name, '{key}'=>$fk, '{table}'=>$table->name)));
1419 
1420             if(isset($table->foreignKeys[$fk]))

Stack Trace

#6
+
 /var/www/u1302250/data/home/wb/waysbook/server/vendor/twig/twig/lib/Twig/Template.php(358): CActiveRecord->offsetExists("commentsCount")
353         // array
354         if (Twig_Template::METHOD_CALL !== $type) {
355             $arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item;
356 
357             if ((is_array($object) && array_key_exists($arrayItem, $object))
358                 || ($object instanceof ArrayAccess && isset($object[$arrayItem]))
359             ) {
360                 if ($isDefinedTest) {
361                     return true;
362                 }
363 
#7
+
 /var/www/u1302250/data/home/wb/waysbook/server/protected/runtime/twigCache/ec/c3/b4a5988fdc1c34675554d2d3838aacd130d1292c3b493140034b4dd9acea.php(96): Twig_Template->getAttribute(Journal, "commentsCount")
091         echo "            <div class=\"cr\"></div>
092         </div>
093         <div class=\"info\">
094             <span class=\"comments\">";
095         // line 34
096         echo twig_escape_filter($this->env, $this->getAttribute((isset($context["news"]) ? $context["news"] : null), "commentsCount"), "html", null, true);
097         echo "</span>
098             <span class=\"views\">";
099         // line 35
100         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute((isset($context["news"]) ? $context["news"] : null), "views"), "amount"), "html", null, true);
101         echo "</span>
#8
+
 /var/www/u1302250/data/home/wb/waysbook/server/vendor/twig/twig/lib/Twig/Template.php(278): __TwigTemplate_ecc3b4a5988fdc1c34675554d2d3838aacd130d1292c3b493140034b4dd9acea->doDisplay(array("feed" => array(Journal, Journal, Journal, Journal, ...), "model" => Journal, "tab" => null, "pages" => CPagination, ...), array())
273     }
274 
275     protected function displayWithErrorHandling(array $context, array $blocks = array())
276     {
277         try {
278             $this->doDisplay($context, $blocks);
279         } catch (Twig_Error $e) {
280             if (!$e->getTemplateFile()) {
281                 $e->setTemplateFile($this->getTemplateName());
282             }
283 
2024-03-19 06:54:42 Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 Phusion_Passenger/5.3.7 Yii Framework/1.1.14