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/ba/d0/f3c661e30593888c3ea9d39d72e4ab770311e08c241213c7b12503c90a1c.php(67): Twig_Template->getAttribute(Forum, "commentsCount")
62             echo "</a>
63             </div>
64             <div class=\"info\">
65                 <span class=\"comments\">";
66             // line 12
67             echo twig_escape_filter($this->env, $this->getAttribute((isset($context["post"]) ? $context["post"] : null), "commentsCount"), "html", null, true);
68             echo "</span>
69                 ";
70             // line 15
71             echo "                <div class=\"cr\"></div>
72             </div>
#8
+
 /var/www/u1302250/data/home/wb/waysbook/server/vendor/twig/twig/lib/Twig/Template.php(144): __TwigTemplate_bad0f3c661e30593888c3ea9d39d72e4ab770311e08c241213c7b12503c90a1c->block_postsContent(array("forumPosts" => array(Forum), "model" => Country, "pages" => 0, "return" => "/", ...), array())
139             $block = null;
140         }
141 
142         if (null !== $template) {
143             try {
144                 $template->$block($context, $blocks);
145             } catch (Twig_Error $e) {
146                 throw $e;
147             } catch (Exception $e) {
148                 throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getTemplateName(), $e);
149             }
2024-03-29 14:48:36 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