Merge pull request #267 from creative-commoners/pulls/3.1/remove-json-methods

FIX Replace Convert JSON methods with json_* methods, deprecated from SilverStripe 4.4
This commit is contained in:
Dylan Wagstaff 2018-10-29 11:05:43 +13:00 committed by GitHub
commit f74d91041b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -27,7 +27,7 @@ abstract class CommentHandler extends Handler
$this->updateComment($comment);
}
$response = new HTTPResponse(Convert::raw2json([
$response = new HTTPResponse(json_encode([
'done' => true,
'records' => $ids,
]));

View File

@ -37,7 +37,7 @@ class Handler extends GridFieldBulkActionHandler
$record->markSpam();
}
$response = new HTTPResponse(Convert::raw2json(array(
$response = new HTTPResponse(json_encode(array(
'done' => true,
'records' => $ids
)));
@ -60,7 +60,7 @@ class Handler extends GridFieldBulkActionHandler
$record->markApproved();
}
$response = new HTTPResponse(Convert::raw2json(array(
$response = new HTTPResponse(json_encode(array(
'done' => true,
'records' => $ids
)));

View File

@ -146,7 +146,7 @@ class CommentForm extends Form
// load user data from previous form request back into form.
if (array_key_exists('UserData', $data)) {
$formData = Convert::json2array($data['UserData']);
$formData = json_decode($data['UserData'], true);
$this->loadDataFrom([
'Name' => isset($formData['Name']) ? $formData['Name'] : '',
@ -199,7 +199,7 @@ class CommentForm extends Form
// cache users data
$form->setSessionData([
'UserData' => Convert::raw2json($data),
'UserData' => json_encode($data),
'Comment' => $data['Comment']
]);
@ -270,7 +270,7 @@ class CommentForm extends Form
// cache users data (name, email, etc to prepopulate on other forms).
$form->setSessionData([
'UserData' => Convert::raw2json($data),
'UserData' => json_encode($data),
]);
// Find parent link