Merge pull request #68 from creative-commoners/pulls/3.0/remove-json-methods

FIX Replace Convert JSON methods with json_* methods, deprecated from SilverStripe 4.4
This commit is contained in:
Guy Marriott 2018-10-29 11:28:25 +13:00 committed by GitHub
commit 6d39bc23ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();
}