? Failure

User tests: Successful: Unsuccessful:

avatar Spudley
Spudley
23 May 2017

Pull Request for Issue #16185 .

Summary of Changes

Added Serializable interface and methods to JTable. Excluding the DB object from serialization, because under some circumstances the DB object may contain closures; these are unserializable, and thus caused a crash when serializing JTable.

Testing Instructions

  • Install Joomla any of 3.7.0 / 3.7.1 / 3.7.2.
  • Install K2 extension.
  • Create a K2 category and add some articles to it.
  • Create a menu entry for the category view.
  • Navigate to the menu entry: It should work.
  • Turn on Joomla's debug mode.
  • Navigate to the menu entry again: It will crash with Serialization of 'Closure' is not allowed.
  • Now install the patch.
  • Keep debug mode enabled.
  • Navigate to the menu entry again: It should now work correctly.

Expected result

See above: The category view should work correctly in debug mode.

Actual result

Without the patch, navigating to the category view in debug mode crashes and gives the following error:

Exception
Serialization of 'Closure' is not allowed
.../libraries/joomla/cache/controller/callback.php:184

Documentation Changes Required

None.

avatar Spudley Spudley - open - 23 May 2017
avatar Spudley Spudley - change - 23 May 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 May 2017
Category Libraries
avatar Spudley Spudley - change - 23 May 2017
Labels Added: ?
avatar brianteeman
brianteeman - comment - 23 May 2017

Please see the comments by @mbabker on this at #16185

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 May 2017

Comment of mbabker sounds like "no Core Issue" > close, @brianteeman?

avatar brianteeman
brianteeman - comment - 24 May 2017

i would leave it to @mbabker or @rdeutz to make that decision

avatar rdeutz
rdeutz - comment - 24 May 2017

In some way this follows the advice Michale gave, but I have my doubts if we should cache table data this way. I might miss the point but what is when we cache the user table data, would that not allow to get the user data out of the cache and maybe misuse it. Maybe I am too paranoid :-)

avatar mbabker
mbabker - comment - 24 May 2017

Personally I think caching a database related object (JTable, JDatabaseDriver) is asking for trouble and you're better off caching just the record data. Unfortunately there isn't an eloquent way to get just the record data (get_object_vars() can work as long as you aren't running it from within the class and the only public properties are the ones created with the field structure).

The fix here is technically valid, anyone who is doing something resulting in the serialization of JTable objects avoids running into a scenario where the database driver gets included into the mix, and that's in general not a good object to serialize.

avatar Spudley
Spudley - comment - 6 Jun 2017

@mbabker, @rdeutz -- I'm not totally clear from your comments here whether you're falling in favour of this PR or against it? I'm hoping the fact that it hasn't been closed means you're still considering it? :)

avatar Kev1n337 Kev1n337 - test_item - 21 Aug 2017 - Tested unsuccessfully
avatar Kev1n337
Kev1n337 - comment - 21 Aug 2017

I have tested this item ? unsuccessfully on 82f9364

I wasn't able to reproduce this issue following these steps:

  • Installed Joomla 3.7.0
  • Installed K2 extension
  • Created K2 Categories
  • Created new items and attached them to the new category
  • Created menu item directing to the articles in this category
  • navigated to this view
  • It works
  • After enabling "Debug System" in Global configuration, it still works the same as before

@icampus


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

avatar brianteeman
brianteeman - comment - 21 Aug 2017

Note. K2 had a lot of updates last week so "maybe" they changed something.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Jul 2019

Note. K2 had a lot of updates last week so "maybe" they changed something.

@Spudley can you please at this?

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Jul 2019
Status Pending Information Required
avatar jwaisner
jwaisner - comment - 11 Mar 2020

@Spudley are you able to update this PR if this is still something that needs resolved?

avatar Spudley
Spudley - comment - 11 Mar 2020

@Spudley are you able to update this PR if this is still something that needs resolved?

Hi @jwaisner. I am no longer maintaining the Joomla system that was exhibiting the bug and it's been two years since I last thought about it, so I'm not really in a position to follow it up any longer. Thank you.

avatar joomla-cms-bot joomla-cms-bot - close - 11 Mar 2020
avatar jwaisner jwaisner - change - 11 Mar 2020
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2020-03-11 21:40:16
Closed_By jwaisner
avatar joomla-cms-bot joomla-cms-bot - change - 11 Mar 2020
Closed_Date 2020-03-11 21:40:16 2020-03-11 21:40:17
Closed_By jwaisner joomla-cms-bot
avatar joomla-cms-bot
joomla-cms-bot - comment - 11 Mar 2020

Set to "closed" on behalf of @jwaisner by The JTracker Application at issues.joomla.org/joomla-cms/16216

avatar jwaisner
jwaisner - comment - 11 Mar 2020

Closing PR and reopened issue report #16185


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

Add a Comment

Login with GitHub to post a comment