Merge pull request #400 from creative-commoners/pulls/2.1/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:46:16 +13:00 committed by GitHub
commit 3afdd01d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -545,7 +545,7 @@ class SiteTreeSubsites extends DataExtension
$subsite = Subsite::currentSubsite();
if ($subsite && $subsite->exists() && $subsite->PageTypeBlacklist) {
// SS 4.1: JSON encoded. SS 4.0, comma delimited
$blacklist = Convert::json2array($subsite->PageTypeBlacklist);
$blacklist = json_decode($subsite->PageTypeBlacklist, true);
if ($blacklist === false) {
$blacklist = explode(',', $subsite->PageTypeBlacklist);
}

View File

@ -268,7 +268,7 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
Subsite::changeSubsite($s1);
$cmsmain = CMSMain::create();
$hints = Convert::json2array($cmsmain->SiteTreeHints());
$hints = json_decode($cmsmain->SiteTreeHints(), true);
$classes = $hints['Root']['disallowedChildren'];
$this->assertContains(ErrorPage::class, $classes);
$this->assertContains(TestClassA::class, $classes);
@ -279,7 +279,7 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
if ($cmsmain->hasMethod('getHintsCache')) {
$cmsmain->getHintsCache()->clear();
}
$hints = Convert::json2array($cmsmain->SiteTreeHints());
$hints = json_decode($cmsmain->SiteTreeHints(), true);
$classes = $hints['Root']['disallowedChildren'];
$this->assertNotContains(ErrorPage::class, $classes);