No Code Attached Yet bug
avatar sakicnet
sakicnet
18 Sep 2022

Steps to reproduce the issue

  • Turn on caching in Global Configuration.
  • Publish mod_articles_categories module and set it to display all categories.
  • Reload the frontend and you will get following error:
    Serialization of 'Closure' is not allowed

Expected result

Displaying list of categories.

Actual result

Error 500: Serialization of 'Closure' is not allowed

System information (as much as possible)

The bug is present in prod 4.2.2 and 4.2.3-dev

Additional comments

The bug was not present in 4.1.5 version.

Votes

# of Users Experiencing Issue
2/2
Average Importance Score
5.00

avatar sakicnet sakicnet - open - 18 Sep 2022
avatar sakicnet sakicnet - change - 18 Sep 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 18 Sep 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Sep 2022
avatar alikon
alikon - comment - 19 Sep 2022

confirmed probably regression from #37139

avatar tramber91
tramber91 - comment - 20 Sep 2022

Confirm also, in joomla 4.2.2 (php 8)
I have a blank page with a mod_articles_categories (No error message on my side even if error is enable, just blank page)
If, in advanced Tab option of the module mod_articles_categories, Caching, i enter "No Caching"
I can load my page without issue


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38782.

avatar caglayanevren
caglayanevren - comment - 22 Sep 2022

+1

avatar ReLater
ReLater - comment - 9 Oct 2022

Confirmed for J4.2.3 stable, PHP 8.1

avatar alikon alikon - change - 13 Oct 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-10-13 06:54:50
Closed_By alikon
avatar alikon alikon - close - 13 Oct 2022
avatar alikon alikon - change - 13 Oct 2022
Status Closed New
Closed_Date 2022-10-13 06:54:50
Closed_By alikon
avatar alikon alikon - reopen - 13 Oct 2022
avatar SharkyKZ
SharkyKZ - comment - 25 Nov 2022

Will this B/C break be mitigated?

avatar mrownicki
mrownicki - comment - 13 Dec 2022

Confirm this buq still exist. Joomla 4.2.5 and PHP 8

Serialization of 'Closure' is not allowed
/public_html/libraries/src/Cache/Controller/CallbackController.php:156


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38782.

avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 17 Feb 2023
avatar Sabrina-Travail-Lewagon
Sabrina-Travail-Lewagon - comment - 17 Mar 2023

Bug present on Joomla 4.2.9 too.
Will there be a solution, because not use cache is not a solution ?!

avatar Vegaturk
Vegaturk - comment - 19 Mar 2023

The bug still persists in version 4.2.9
I think there is information that they will fix this problem in version 4.3.0

Until we fix this issue in version 4.3.0 the workaround is to disable cache in articles-categories module


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38782.
avatar joomdonation
joomdonation - comment - 31 Mar 2023

@Denitz Could you please take a look at this issue to see if it is related to your PR #37139 and hopefully come up with a solution ? Thanks !

avatar Denitz
Denitz - comment - 31 Mar 2023

@joomdonation Will do by Monday, please hold on.

avatar joomdonation
joomdonation - comment - 31 Mar 2023

Great. Many thanks @Denitz

avatar Denitz
Denitz - comment - 31 Mar 2023

@joomdonation The issue is unrelated, it's invalid module code: module helper caches array of Joomla\CMS\Categories\CategoryNode objects and each object has _constructor property of Joomla\Component\Content\Site\Service\Category type which can't be serialized because it contains database layer instance and other garbage.

Joomla\Module\ArticlesCategories\Site\Helper\ArticlesCategoriesHelper::getList() should just return array of simple stdClasses

avatar joomdonation
joomdonation - comment - 31 Mar 2023

@Denitz Thanks for the info. Asked you to look at it because someone mentioned reverting your PR solves the issue (haven't really tested it).

avatar Denitz
Denitz - comment - 31 Mar 2023

The issue raised after Jun 18, 2022 via injecting database instance into Categories (via DatabaseAwareTrait) which are stored in node as _constructor property.
The module cache should not serialize database layer, it's ridiculous and just impossible because layer contains non-serialazable objects like i.e. PDOStatement.

Here is this commit:
26c6341

I can do a PR and change the mod_articles_categories cached data to simple stdClass, but only if this PR will be actually merged but not hang around for months/years like other PRs :(

avatar joomdonation
joomdonation - comment - 31 Mar 2023

@Denitz Please make PR. I will test it myself and find someone to test it, too. We should have this fixed ASAP.

avatar alikon
alikon - comment - 31 Mar 2023

i'll test that too @Denitz

avatar Denitz
Denitz - comment - 31 Mar 2023

Many thanks for your help, I will add a PR by the end of Monday, hope tomorrow, please hold on...

avatar Denitz
Denitz - comment - 1 Apr 2023
avatar joomdonation joomdonation - change - 1 Apr 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-04-01 15:53:51
Closed_By joomdonation
avatar joomdonation joomdonation - close - 1 Apr 2023
avatar joomdonation
joomdonation - comment - 1 Apr 2023

@Sabrina-Travail-Lewagon @Vegaturk Please test PR #40275 . It should solve your issue. Thanks !

avatar Vegaturk
Vegaturk - comment - 19 Apr 2023

I have installed version 4.3.0 with great hope that the error can be fixed, I disabled the caching of the module, I turned on caching again, but unfortunately the error persists.
0 Serialization of 'Closure' is not allowed

avatar Denitz
Denitz - comment - 20 Apr 2023

Sure, the patch was not merged into 4.3.0, I guess we can wait for a year.

Add a Comment

Login with GitHub to post a comment