diff --git a/src/Forms/GridField/GridFieldStateManager.php b/src/Forms/GridField/GridFieldStateManager.php index 645ed26fb..727077737 100644 --- a/src/Forms/GridField/GridFieldStateManager.php +++ b/src/Forms/GridField/GridFieldStateManager.php @@ -42,7 +42,7 @@ class GridFieldStateManager implements GridFieldStateManagerInterface $value = $gridField->getState(false)->Value(); // Using a JSON-encoded empty array as the blank value, to avoid changing Value() semantics in a minor release - if ($value === '[]') { + if ($value === '{}') { return $url; } diff --git a/tests/php/Forms/GridField/GridFieldStateManagerTest.php b/tests/php/Forms/GridField/GridFieldStateManagerTest.php index c7ab6738c..586ed696d 100644 --- a/tests/php/Forms/GridField/GridFieldStateManagerTest.php +++ b/tests/php/Forms/GridField/GridFieldStateManagerTest.php @@ -87,7 +87,7 @@ class GridFieldStateManagerTest extends SapphireTest $grid->getState()->initDefaults(['testValue' => 'foo']); $link = '/link-to/something'; - $this->assertEquals('[]', $grid->getState(false)->Value()); + $this->assertEquals('{}', $grid->getState(false)->Value()); $this->assertEquals( '/link-to/something', diff --git a/tests/php/Forms/GridField/GridStateTest.php b/tests/php/Forms/GridField/GridStateTest.php index 4be857871..8598c9780 100644 --- a/tests/php/Forms/GridField/GridStateTest.php +++ b/tests/php/Forms/GridField/GridStateTest.php @@ -29,5 +29,4 @@ class GridStateTest extends SapphireTest 'GridState with changes returns has a JSON object string for Value.' ); } - }