User tests: Successful: Unsuccessful:
Pull Request for Issue #16185 .
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.
Serialization of 'Closure' is not allowed
.See above: The category view should work correctly in debug mode.
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
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Comment of mbabker sounds like "no Core Issue" > close, @brianteeman?
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 :-)
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.
I have tested this item
I wasn't able to reproduce this issue following these steps:
Note. K2 had a lot of updates last week so "maybe" they changed something.
Status | Pending | ⇒ | Information Required |
@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.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-11 21:40:16 |
Closed_By | ⇒ | jwaisner |
Closed_Date | 2020-03-11 21:40:16 | ⇒ | 2020-03-11 21:40:17 |
Closed_By | jwaisner | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @jwaisner by The JTracker Application at issues.joomla.org/joomla-cms/16216
Closing PR and reopened issue report #16185
Please see the comments by @mbabker on this at #16185