Skip to content

Commit

Permalink
set the query type if restored from a browse
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlan-00 committed May 14, 2024
1 parent fb5f390 commit 51e4bce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Repository/Model/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ public function set_filter($key, $value): bool
case 'season_eq':
case 'user':
case 'to_user':
case 'enabled':
$this->_state['filter'][$key] = (int)($value);
break;
case 'exact_match':
Expand Down Expand Up @@ -1154,7 +1153,7 @@ private function _post_process($data): array
private function _sql_filter($filter, $value): string
{
if ($this->queryType === null) {
return '';
$this->set_type($this->_state['type']);
}

return $this->queryType->get_sql_filter($this, $filter, $value);

Check failure on line 1159 in src/Repository/Model/Query.php

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 8.2)

Cannot call method get_sql_filter() on Ampache\Module\Database\Query\QueryInterface|null.

Check failure on line 1159 in src/Repository/Model/Query.php

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 8.3)

Cannot call method get_sql_filter() on Ampache\Module\Database\Query\QueryInterface|null.
Expand Down Expand Up @@ -1197,6 +1196,7 @@ private function _sql_sort($field, $order): string

if ($this->queryType === null) {
return '';
$this->set_type($this->_state['type']);

Check failure on line 1199 in src/Repository/Model/Query.php

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 8.2)

Unreachable statement - code above always terminates.

Check failure on line 1199 in src/Repository/Model/Query.php

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 8.3)

Unreachable statement - code above always terminates.
}

return $this->queryType->get_sql_sort($this, $field, $order);
Expand Down

0 comments on commit 51e4bce

Please sign in to comment.