Skip to content

Commit

Permalink
Move code around a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Dec 2, 2020
1 parent 46db2d9 commit efab02d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions libraries/src/Form/Field/TagField.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,10 @@ protected function getInput()
*/
protected function getOptions()
{
$published = $this->element['published'] ?: array(0, 1);
$app = Factory::getApplication();
$language = null;
$options = [];

// This limit is only used with isRemoteSearch
$prefillLimit = 30;
$published = $this->element['published'] ?: array(0, 1);
$app = Factory::getApplication();
$language = null;
$options = [];
$isRemoteSearch = $this->isRemoteSearch();

$db = Factory::getDbo();
Expand Down Expand Up @@ -201,6 +198,8 @@ protected function getOptions()
// Preload only active values and 30 most used tags or fill up
if ($isRemoteSearch)
{
$prefillLimit = 30;

// Load the most $prefillLimit used tags
$topQuery = $db->getQuery(true)
->select($db->quoteName('tag_id'))
Expand Down

0 comments on commit efab02d

Please sign in to comment.