Skip to content

Commit efc2c39

Browse files
[5.x] Fix error when augmenting Bard fields (#10104)
Co-authored-by: duncanmcclean <[email protected]> Co-authored-by: Jason Varga <[email protected]>
1 parent 9b80ef7 commit efc2c39

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Fieldtypes/Bard.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Statamic\Facades\Entry;
1010
use Statamic\Facades\GraphQL;
1111
use Statamic\Facades\Site;
12+
use Statamic\Fields\Value;
1213
use Statamic\Fieldtypes\Bard\Augmentor;
1314
use Statamic\GraphQL\Types\BardSetsType;
1415
use Statamic\GraphQL\Types\BardTextType;
@@ -245,8 +246,13 @@ public function filter()
245246

246247
protected function performAugmentation($value, $shallow)
247248
{
248-
if ($this->shouldSaveHtml() && is_string($value)) {
249-
return is_null($value) ? $value : $this->resolveStatamicUrls($value);
249+
if ($this->shouldSaveHtml()) {
250+
if (
251+
is_string($value)
252+
|| ($value instanceof Value && is_string($value->value())) // This part is not under test. See https://github.com/statamic/cms/pull/10104
253+
) {
254+
return is_null($value) ? $value : $this->resolveStatamicUrls($value);
255+
}
250256
}
251257

252258
if ($this->isLegacyData($value)) {

0 commit comments

Comments
 (0)