Skip to content

Commit

Permalink
Merge pull request #971 from SlovakNationalGallery/fix-empty-authors
Browse files Browse the repository at this point in the history
Filter out empty values from getUniqueAuthorsWithAuthorityNames
  • Loading branch information
eronisko authored Mar 14, 2024
2 parents aeb61c4 + 17539e6 commit fafb99f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,12 @@ public function getAuthorsWithAuthoritiesAttribute()
return $authorities->concat($authors);
}


public function getUniqueAuthorsWithAuthorityNames()
{
return $this->authors_with_authorities
->pluck('name')
->toArray();
->filter()
->values();
}

public function getFirstAuthorAttribute($value)
Expand Down
2 changes: 1 addition & 1 deletion tests/Models/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function testMergedAuthorityNamesAndAuthors()
]);

$item = Item::factory()->make([
'author' => 'Philips Wouwerman; Vladimír Boudník',
'author' => 'Philips Wouwerman; ; Vladimír Boudník',
]);
$item->authorities()->attach($authority);

Expand Down

0 comments on commit fafb99f

Please sign in to comment.