From 8d128646b31acf3694de86fed26b8a0ceb9ac6dc Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 5 May 2015 22:00:23 +1000 Subject: [PATCH] Fix a lisk issue Summary: This was broken in D12680. ``` EXCEPTION: (PhutilJSONParserException) Parse error on line 0 at column 0: 'null' is not a valid JSON object. at [/src/parser/PhutilJSONParser.php:41] #0 PhutilJSONParser::parse(string) called at [/src/utils/utils.php:1062] #1 phutil_json_decode(string) called at [/src/infrastructure/storage/lisk/LiskDAO.php:1640] #2 LiskDAO::applyLiskDataSerialization(array, boolean) called at [/src/infrastructure/storage/lisk/LiskDAO.php:1386] #3 LiskDAO::willReadData(array) called at [/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php:214] #4 PhabricatorLiskDAO::willReadData(array) called at [/src/infrastructure/storage/lisk/LiskDAO.php:608] #5 LiskDAO::loadFromArray(array) called at [/src/infrastructure/storage/lisk/LiskDAO.php:652] #6 LiskDAO::loadAllFromArray(array) called at [/src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php:62] #7 PhabricatorApplicationTransactionQuery::loadPage() called at [/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:227] #8 PhabricatorPolicyAwareQuery::execute() called at [/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:143] #9 PhabricatorCursorPagedPolicyAwareQuery::executeWithCursorPager(AphrontCursorPagerView) called at [/src/applications/base/controller/PhabricatorController.php:577] #10 PhabricatorController::buildTransactionTimeline(PhabricatorPaste, PhabricatorPasteTransactionQuery) called at [/src/applications/paste/controller/PhabricatorPasteViewControll ``` Test Plan: No exception shown. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12714 --- src/infrastructure/storage/lisk/LiskDAO.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infrastructure/storage/lisk/LiskDAO.php b/src/infrastructure/storage/lisk/LiskDAO.php index 6faa3bb4f8..d21001c0a3 100644 --- a/src/infrastructure/storage/lisk/LiskDAO.php +++ b/src/infrastructure/storage/lisk/LiskDAO.php @@ -1637,7 +1637,7 @@ abstract class LiskDAO { break; case self::SERIALIZATION_JSON: if ($deserialize) { - $data[$col] = phutil_json_decode($data[$col]); + $data[$col] = json_decode($data[$col], true); } else { $data[$col] = json_encode($data[$col]); }