Skip to content

Commit 090a3f8

Browse files
committed
Prepare SEO Pro for blueprint parent changes.
1 parent 11a3f4c commit 090a3f8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Fieldtypes/SeoProFieldtype.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Statamic\SeoPro\Fieldtypes;
44

5+
use Statamic\Contracts\Entries\Entry;
6+
use Statamic\Contracts\Taxonomies\Term;
57
use Statamic\Facades\Blueprint;
68
use Statamic\Fields\Fields as BlueprintFields;
79
use Statamic\Fields\Fieldtype;
@@ -51,7 +53,11 @@ protected function fields()
5153

5254
protected function fieldConfig()
5355
{
54-
return SeoProFields::new($this->field()->parent())->getConfig();
56+
if ($this->field()->parent() instanceof Entry || $this->field()->parent() instanceof Term) {
57+
$parent = $this->field()->parent();
58+
}
59+
60+
return SeoProFields::new($parent ?? null)->getConfig();
5561
}
5662

5763
public function augment($data)

0 commit comments

Comments
 (0)