Skip to content

Fix issue with callback cache controller hashing Closures#14057

Merged
wilsonge merged 2 commits intojoomla:stagingfrom
mbabker:cache-closure-fix
Feb 14, 2017
Merged

Fix issue with callback cache controller hashing Closures#14057
wilsonge merged 2 commits intojoomla:stagingfrom
mbabker:cache-closure-fix

Conversation

@mbabker
Copy link
Copy Markdown
Contributor

@mbabker mbabker commented Feb 13, 2017

Summary of Changes

When using a Closure with the cache's callback controller, generating the ID will fail because it attempts to serialize a Closure which isn't allowed. Change the code to use an object hash for the Closure instead.

Testing Instructions

Probably should be easily triggered just by turning on caching for core because there are a few places where Closures are used now. Failing that, I guess something like this should work as a test case:

JFactory::getCache('_system', 'callback')->get(function () { echo 'Hello World!'; });

Expected result

Page displays correctly

Actual result

Page errors out due to attempted serialization of a Closure

Documentation Changes Required

N/A

@wilsonge
Copy link
Copy Markdown
Contributor

Merging on code review and the test by @waader in #13262

@wilsonge wilsonge merged commit 73f9aa1 into joomla:staging Feb 14, 2017
@wilsonge wilsonge added this to the Joomla 3.7.0 milestone Feb 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants