Skip to content

Commit

Permalink
Fix condition
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni committed Jul 11, 2024
1 parent 51483b0 commit 2e83023
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Taxonomies/LocalizedTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public function route()
{
$taxonomySlug = Str::replace('_', '-', $this->taxonomyHandle());

if (! $this->taxonomy()->isAssignedToCollection()) {
if ($this->collection() && ! $this->taxonomy()->isAssignedToCollection()) {
return URL::tidy("/{$taxonomySlug}/{slug}");
}

Expand Down
4 changes: 2 additions & 2 deletions src/Taxonomies/Taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public function uri()
{
$taxonomySlug = Str::replace('_', '-', $this->handle);

if (! $this->isAssignedToCollection()) {
if ($this->collection() && ! $this->isAssignedToCollection()) {
return URL::tidy("/{$taxonomySlug}");
}

Expand All @@ -369,7 +369,7 @@ public function collections()

public function isAssignedToCollection()
{
return $this->collection() && $this->collections()->contains($this->collection());
return $this->collections()->contains($this->collection());
}

public function toResponse($request)
Expand Down

0 comments on commit 2e83023

Please sign in to comment.