diff --git a/src/Entries/Collection.php b/src/Entries/Collection.php index 28193e31f2..c232f5b2d4 100644 --- a/src/Entries/Collection.php +++ b/src/Entries/Collection.php @@ -336,20 +336,22 @@ public function fallbackEntryBlueprint() public function ensureEntryBlueprintFields($blueprint) { - $blueprint->ensureFieldPrepended('title', [ - 'type' => ($auto = $this->autoGeneratesTitles()) ? 'hidden' : 'text', - 'required' => ! $auto, - ]); + if (! $blueprint->hasField('title')) { + $blueprint->ensureFieldPrepended('title', [ + 'type' => ($auto = $this->autoGeneratesTitles()) ? 'hidden' : 'text', + 'required' => ! $auto, + ]); + } - if ($this->requiresSlugs()) { + if ($this->requiresSlugs() && ! $blueprint->hasField('slug')) { $blueprint->ensureField('slug', ['type' => 'slug', 'localizable' => true], 'sidebar'); } - if ($this->dated()) { + if ($this->dated() && ! $blueprint->hasField('date')) { $blueprint->ensureField('date', ['type' => 'date', 'required' => true, 'default' => 'now'], 'sidebar'); } - if ($this->hasStructure() && ! $this->orderable()) { + if ($this->hasStructure() && ! $this->orderable() && ! $blueprint->hasField('parent')) { $blueprint->ensureField('parent', [ 'type' => 'entries', 'collections' => [$this->handle()], @@ -360,6 +362,10 @@ public function ensureEntryBlueprintFields($blueprint) } foreach ($this->taxonomies() as $taxonomy) { + if ($blueprint->hasField($taxonomy->handle())) { + continue; + } + $blueprint->ensureField($taxonomy->handle(), [ 'type' => 'terms', 'taxonomies' => [$taxonomy->handle()],