Skip to content

Commit 20c8888

Browse files
[5.x] Fix dates in localizations when duplicating entries (#11361)
1 parent 8d477de commit 20c8888

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Actions/DuplicateEntry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private function duplicateEntry(Entry $original, ?string $origin = null)
8888
$entry->slug($slug);
8989
}
9090

91-
if ($original->hasDate()) {
91+
if ($original->hasExplicitDate()) {
9292
$entry->date($original->date());
9393
}
9494

src/Entries/Entry.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,11 @@ public function hasSeconds()
622622
return $this->blueprint()->field('date')->fieldtype()->secondsEnabled();
623623
}
624624

625+
public function hasExplicitDate(): bool
626+
{
627+
return $this->hasDate() && $this->date;
628+
}
629+
625630
public function sites()
626631
{
627632
return $this->collection()->sites();

0 commit comments

Comments
 (0)