No Code Attached Yet
avatar michele-tramonti
michele-tramonti
26 Feb 2022

Steps to reproduce the issue

  • create a contact category
  • create several contacts, and put them all in this category
  • create a menu item of type "List Contacts in a Category", and set the "filter field" option to "show" in list layouts
  • if front end visit that page
  • apply a filtering criteria
  • apply again a filtering criteria (or simply reset)

Expected result

  • accessing the page for the first time: you can see the complete (or at least paginated) list of contacts
  • submitting the criteria for the first time: you can see a list of contacts filtered by the criteria
  • submitting again another criteria: you can see a list of contacts filtered by the criteria

Actual result

  • accessing the page for the first time: you can see the complete (or at least paginated) list of contacts
  • submitting the criteria for the first time: you can see a list of contacts filtered by the criteria
  • submitting again another criteria (or simply reset): error page saying "0 Object of class stdClass could not be converted to string"

System information (as much as possible)

  • Joomla! Version 4.1.0
  • PHP Version 8.0.12
  • Template g5_helium
  • Database 10.3.31-MariaDB-log-cll-lve
  • Collation latin1_swedish_ci
  • Conn Collation utf8mb4_general_ci

Additional comments

putting joomla in debug mode give this call stack:

# Function Location
1 () JROOT/libraries/src/MVC/Model/ListModel.php:339
2 Joomla\CMS\MVC\Model\ListModel->getStoreId() JROOT/libraries/src/MVC/Model/ListModel.php:261
3 Joomla\CMS\MVC\Model\ListModel->getItems() JROOT/components/com_contact/src/Model/CategoryModel.php:121
4 Joomla\Component\Contact\Site\Model\CategoryModel->getItems() JROOT/libraries/src/MVC/View/AbstractView.php:153
5 Joomla\CMS\MVC\View\AbstractView->get() JROOT/libraries/src/MVC/View/CategoryView.php:159
6 Joomla\CMS\MVC\View\CategoryView->commonCategoryDisplay() JROOT/components/com_contact/src/View/Category/HtmlView.php:61
7 Joomla\Component\Contact\Site\View\Category\HtmlView->display() JROOT/libraries/src/MVC/Controller/BaseController.php:697
8 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/components/com_contact/src/Controller/DisplayController.php:80
9 Joomla\Component\Contact\Site\Controller\DisplayController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:735
10 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:146
11 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT/components/com_contact/src/Dispatcher/Dispatcher.php:45
12 Joomla\Component\Contact\Site\Dispatcher\Dispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:389
13 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:204
14 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:243
15 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:278
16 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:63
17 require_once() JROOT/index.php:32
avatar michele-tramonti michele-tramonti - open - 26 Feb 2022
avatar joomla-cms-bot joomla-cms-bot - change - 26 Feb 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Feb 2022
avatar michele-tramonti
michele-tramonti - comment - 26 Feb 2022

after issuing the error, every subsequent visit to the page will lead to the error page.
it is probably related to session cookies: if you wait long enough after the error, visiting the page will show the list.
The same thing happen if you delete cookies after the error: visiting the page will show no error

avatar brianteeman
brianteeman - comment - 26 Feb 2022

please test #37139

avatar michele-tramonti
michele-tramonti - comment - 26 Feb 2022

thank you for the quick reply.
I've tested #37139 (edited my 4 files to reflect those, and enabled conservative cache) but the issue is still showing up.

avatar nikosdion
nikosdion - comment - 1 Mar 2022

It looks like the limit.start in the session has an object instead of a string or number. This causes a TypeError in PHP 8 (it was a warning on earlier versions). This is unrelated to #37139, that PR deals with caching issues.

The real problem is components/com_contact/src/Model/CategoryModel.php line 295. It reads:
'com_contact.category.list',
when it should be reading
'com_contact.category.list.limit',
since we're trying to get the state of the list LIMIT, not the entire subset of list options in the user state...

avatar alikon alikon - change - 2 Mar 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-03-02 07:23:41
Closed_By alikon
avatar alikon alikon - close - 2 Mar 2022
avatar alikon
alikon - comment - 2 Mar 2022

thanks for the tip
please test #37166

Add a Comment

Login with GitHub to post a comment