Skip to content

Commit

Permalink
FIX Replace Convert JSON methods with json_* methods, deprecated from…
Browse files Browse the repository at this point in the history
… SilverStripe 4.4
  • Loading branch information
robbieaverill committed Oct 28, 2018
1 parent 6126dbd commit 4a4d3ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Controllers/AdvancedWorkflowActionController.php
Expand Up @@ -50,7 +50,7 @@ public function transition($request)
'link' => $instance->getTarget()->AbsoluteLink()
);
if (Director::is_ajax()) {
return Convert::raw2json($result);
return json_encode($result);
}
return $this->redirect($instance->getTarget()->Link());
}
Expand All @@ -60,7 +60,7 @@ public function transition($request)
$result = array(
'success' => false,
);
return Convert::raw2json($result);
return json_encode($result);
}

return $this->redirect($instance->getTarget()->Link());
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/FrontendWorkflowForm.php
Expand Up @@ -111,7 +111,7 @@ public function httpSubmission($request)
$acceptType = $request->getHeader('Accept');
if (strpos($acceptType, 'application/json') !== false) {
// Send validation errors back as JSON with a flag at the start
$response = new HTTPResponse(Convert::array2json($this->validator->getErrors()));
$response = new HTTPResponse(json_encode($this->validator->getErrors()));
$response->addHeader('Content-Type', 'application/json');
} else {
$this->setupFormErrors();
Expand Down

0 comments on commit 4a4d3ea

Please sign in to comment.