FIX Replace Convert JSON methods with json_* methods, deprecated from SilverStripe 4.4

This commit is contained in:
Robbie Averill 2018-10-28 21:40:35 +00:00
parent 21d8212807
commit fc934d93fd

View File

@ -122,7 +122,7 @@ class EditableSpamProtectionField extends EditableFormField
*/
public function onBeforeWrite()
{
$fieldMap = Convert::json2array($this->SpamFieldSettings);
$fieldMap = json_decode($this->SpamFieldSettings, true);
if (empty($fieldMap)) {
$fieldMap = array();
}
@ -132,7 +132,7 @@ class EditableSpamProtectionField extends EditableFormField
$fieldMap[substr($key, 8)] = $value;
}
}
$this->setField('SpamFieldSettings', Convert::raw2json($fieldMap));
$this->setField('SpamFieldSettings', json_encode($fieldMap));
return parent::onBeforeWrite();
}
@ -192,7 +192,7 @@ class EditableSpamProtectionField extends EditableFormField
*/
public function spamMapValue($mapSetting)
{
$map = Convert::json2array($this->SpamFieldSettings);
$map = json_decode($this->SpamFieldSettings, true);
if (empty($map)) {
$map = array();
}