Kunena / Kunena-Addons

Modules and plugins for Kunena 6.0.
https://www.kunena.org
8 stars 22 forks source link

[Kunena Latest 6.0.4 and 6.0.5] Error when setting is changed #312

Closed rich20 closed 10 months ago

rich20 commented 11 months ago

https://www.kunena.org/forum/k-6-2-0-support/168229-0-count-argument-1-$value-must-be-of-type-countable-array,-int-given Confirmed

To Reproduce Change something in the Klatest settings

Result Error: 0 count(): Argument #1 ($value) must be of type Countable|array, int given

Additional context Even if you reset the setting, the error remains.

                                        <div>

Call stack

| Function | Location

1 | () | JROOT/components/com_kunena/src/Model/TopicsModel.php:618 2 | count() | JROOT/components/com_kunena/src/Model/TopicsModel.php:618 3 | Kunena\Forum\Site\Model\TopicsModel->populateState() | JROOT/libraries/src/MVC/Model/StateBehaviorTrait.php:59 4 | Joomla\CMS\MVC\Model\BaseModel->getState() | JROOT/libraries/src/MVC/View/AbstractView.php:152 5 | Joomla\CMS\MVC\View\AbstractView->get() | JROOT/libraries/kunena/src/View/KunenaView.php:268 6 | Kunena\Forum\Libraries\View\KunenaView->displayLayout() | JROOT/libraries/kunena/src/Forum/KunenaForum.php:526 7 | Kunena\Forum\Libraries\Forum\KunenaForum::display() | JROOT/modules/mod_kunenalatest/src/ModuleKunenaLatest.php:108 8 | Kunena\Module\KunenaLatest\Site\ModuleKunenaLatest->_display() | JROOT/libraries/kunena/src/Module/KunenaModule.php:113 9 | Kunena\Forum\Libraries\Module\KunenaModule->display() | JROOT/modules/mod_kunenalatest/mod_kunenalatest.php:38 10 | include() | JROOT/libraries/src/Dispatcher/ModuleDispatcher.php:52 11 | Joomla\CMS\Dispatcher\ModuleDispatcher::Joomla\CMS\Dispatcher{closure}() | JROOT/libraries/src/Dispatcher/ModuleDispatcher.php:55 12 | Joomla\CMS\Dispatcher\ModuleDispatcher->dispatch() | JROOT/libraries/src/Helper/ModuleHelper.php:281 13 | Joomla\CMS\Helper\ModuleHelper::renderRawModule() | JROOT/libraries/src/Helper/ModuleHelper.php:161 14 | Joomla\CMS\Helper\ModuleHelper::renderModule() | JROOT/libraries/src/Document/Renderer/Html/ModuleRenderer.php:99 15 | Joomla\CMS\Document\Renderer\Html\ModuleRenderer->render() | JROOT/libraries/src/Document/HtmlDocument.php:671 16 | Joomla\CMS\Document\HtmlDocument->countModules() | JROOT/templates/cassiopeia/index.php:100 17 | require() | JROOT/libraries/src/Document/HtmlDocument.php:721 18 | Joomla\CMS\Document\HtmlDocument->_loadTemplate() | JROOT/libraries/src/Document/HtmlDocument.php:776 19 | Joomla\CMS\Document\HtmlDocument->_fetchTemplate() | JROOT/libraries/src/Document/HtmlDocument.php:612 20 | Joomla\CMS\Document\HtmlDocument->parse() | JROOT/libraries/src/Application/CMSApplication.php:1012 21 | Joomla\CMS\Application\CMSApplication->render() | JROOT/libraries/src/Application/SiteApplication.php:724 22 | Joomla\CMS\Application\SiteApplication->render() | JROOT/libraries/src/Application/CMSApplication.php:298 23 | Joomla\CMS\Application\CMSApplication->execute() | JROOT/includes/app.php:61 24 | require_once() | JROOT/index.php:32

System information

Desktop

xillibit commented 10 months ago

I'am not able to reproduce this issue

rich20 commented 10 months ago

Found the cause. When K-Latest is reinstalled, nothing is marked in the selection. Bildschirmfoto vom 2023-12-31 14-07-18

If you select something and save, the error is gone. Bildschirmfoto vom 2023-12-31 14-07-46

You can test it:

  1. Uninstall Kunena-Latest
  2. Install it again
  3. Assign it to a position and publish it
xillibit commented 10 months ago

Fixed by : https://github.com/Kunena/Kunena-Forum/commits/K6.2/