Skip to content

Commit

Permalink
[4.x] Only search for descendants if multi-site mode is enabled (#9528)
Browse files Browse the repository at this point in the history
  • Loading branch information
helloiamlukas authored Feb 14, 2024
1 parent d6fc17f commit 77c1aa3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Actions/DuplicateEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Support\Str;
use Statamic\Contracts\Entries\Entry;
use Statamic\Facades\Entry as Entries;
use Statamic\Facades\Site;
use Statamic\Facades\User;

class DuplicateEntry extends Action
Expand All @@ -21,7 +22,7 @@ public function visibleTo($item)

public function confirmationText()
{
$hasDescendants = $this->items
$hasDescendants = Site::hasMultiple() && $this->items
->map(fn ($entry) => $entry->hasOrigin() ? $entry->root() : $entry)
->unique()
->contains(fn ($entry) => $entry->descendants()->count());
Expand Down

0 comments on commit 77c1aa3

Please sign in to comment.