mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
FIX Replace Convert JSON methods with json_* methods, deprecated from SilverStripe 4.4
This commit is contained in:
parent
def91bb6d1
commit
d38e7c5b67
@ -27,7 +27,7 @@ abstract class CommentHandler extends Handler
|
|||||||
$this->updateComment($comment);
|
$this->updateComment($comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = new HTTPResponse(Convert::raw2json([
|
$response = new HTTPResponse(json_encode([
|
||||||
'done' => true,
|
'done' => true,
|
||||||
'records' => $ids,
|
'records' => $ids,
|
||||||
]));
|
]));
|
||||||
|
@ -37,7 +37,7 @@ class Handler extends GridFieldBulkActionHandler
|
|||||||
$record->markSpam();
|
$record->markSpam();
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = new HTTPResponse(Convert::raw2json(array(
|
$response = new HTTPResponse(json_encode(array(
|
||||||
'done' => true,
|
'done' => true,
|
||||||
'records' => $ids
|
'records' => $ids
|
||||||
)));
|
)));
|
||||||
@ -60,7 +60,7 @@ class Handler extends GridFieldBulkActionHandler
|
|||||||
$record->markApproved();
|
$record->markApproved();
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = new HTTPResponse(Convert::raw2json(array(
|
$response = new HTTPResponse(json_encode(array(
|
||||||
'done' => true,
|
'done' => true,
|
||||||
'records' => $ids
|
'records' => $ids
|
||||||
)));
|
)));
|
||||||
|
@ -146,7 +146,7 @@ class CommentForm extends Form
|
|||||||
|
|
||||||
// load user data from previous form request back into form.
|
// load user data from previous form request back into form.
|
||||||
if (array_key_exists('UserData', $data)) {
|
if (array_key_exists('UserData', $data)) {
|
||||||
$formData = Convert::json2array($data['UserData']);
|
$formData = json_decode($data['UserData'], true);
|
||||||
|
|
||||||
$this->loadDataFrom([
|
$this->loadDataFrom([
|
||||||
'Name' => isset($formData['Name']) ? $formData['Name'] : '',
|
'Name' => isset($formData['Name']) ? $formData['Name'] : '',
|
||||||
@ -199,7 +199,7 @@ class CommentForm extends Form
|
|||||||
|
|
||||||
// cache users data
|
// cache users data
|
||||||
$form->setSessionData([
|
$form->setSessionData([
|
||||||
'UserData' => Convert::raw2json($data),
|
'UserData' => json_encode($data),
|
||||||
'Comment' => $data['Comment']
|
'Comment' => $data['Comment']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ class CommentForm extends Form
|
|||||||
|
|
||||||
// cache users data (name, email, etc to prepopulate on other forms).
|
// cache users data (name, email, etc to prepopulate on other forms).
|
||||||
$form->setSessionData([
|
$form->setSessionData([
|
||||||
'UserData' => Convert::raw2json($data),
|
'UserData' => json_encode($data),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Find parent link
|
// Find parent link
|
||||||
|
Loading…
Reference in New Issue
Block a user