Skip to content

Commit

Permalink
Fix assigning more than 10 teasers when using elasticsearch (#4998)
Browse files Browse the repository at this point in the history
* Fix assigning more than 10 teasers when using elasticsearch

* Fix TestUserProvider

Co-authored-by: Alexander Schranz <alexander@sulu.io>
  • Loading branch information
danrot and alexander-schranz committed Jan 22, 2020
1 parent c6a2fa1 commit b26a3c4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
CHANGELOG for Sulu
==================

* dev-release/1.6
* BUGFIX #4998 [ContentBundle] Fix assigning more than 10 teasers when using elasticsearch

* 1.6.30 (2020-01-13)
* ENHANCEMENT #4968 [MediaBundle] Improve performance for one layered images

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function($item) {
->createSearch(implode(' OR ', $statements))
->indexes($this->getPageIndexes())
->locale($locale)
->setLimit(count($ids))
->execute();

/** @var QueryHit $item */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function($searchQuery) use ($ids) {
)->willReturn($this->search->reveal())->shouldBeCalled();
$this->search->indexes(['page_sulu_io_published'])->willReturn($this->search->reveal())->shouldBeCalled();
$this->search->locale('de')->willReturn($this->search->reveal())->shouldBeCalled();
$this->search->setLimit(2)->willReturn($this->search->reveal())->shouldBeCalled();
$this->search->execute()->willReturn(
[$this->createQueryHit($ids[0], $data[$ids[0]]), $this->createQueryHit($ids[1], $data[$ids[1]])]
);
Expand Down
3 changes: 1 addition & 2 deletions src/Sulu/Bundle/TestBundle/Testing/TestUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Sulu\Bundle\TestBundle\Testing;

use Doctrine\ORM\EntityManager;
use Sulu\Bundle\SecurityBundle\Entity\User;
use Sulu\Component\Contact\Model\ContactRepositoryInterface;
use Sulu\Component\Security\Authentication\UserRepositoryInterface;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
Expand Down Expand Up @@ -141,7 +140,7 @@ public function refreshUser(UserInterface $user)
*/
public function supportsClass($class)
{
return $class instanceof UserInterface;
return is_subclass_of($class, UserInterface::class);
}

/**
Expand Down

0 comments on commit b26a3c4

Please sign in to comment.