Skip to content

Commit

Permalink
Merge branch 'QA_5_2'
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Feb 7, 2022
2 parents b5096a4 + b59d46b commit bc58521
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions libraries/classes/Display/Results.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class Results
* table: string,
* goto: string,
* sql_query: string,
* unlim_num_rows: int|numeric-string,
* unlim_num_rows: int|numeric-string|false,
* fields_meta: FieldMetadata[],
* is_count: bool|null,
* is_export: bool|null,
Expand Down Expand Up @@ -726,7 +726,7 @@ private function getHtmlPageSelector(): array
{
$pageNow = (int) floor($_SESSION['tmpval']['pos'] / $_SESSION['tmpval']['max_rows']) + 1;

$nbTotalPage = (int) ceil($this->properties['unlim_num_rows'] / $_SESSION['tmpval']['max_rows']);
$nbTotalPage = (int) ceil((int) $this->properties['unlim_num_rows'] / $_SESSION['tmpval']['max_rows']);

$output = '';
if ($nbTotalPage > 1) {
Expand Down Expand Up @@ -796,7 +796,8 @@ private function getTableNavigation(
// Move to the next page or to the last one
$moveForwardButtons = '';
if (
$this->properties['unlim_num_rows'] === false // view with unknown number of rows
// view with unknown number of rows
($this->properties['unlim_num_rows'] === -1 || $this->properties['unlim_num_rows'] === false)
|| (! $isShowingAll
&& intval($_SESSION['tmpval']['pos']) + intval($_SESSION['tmpval']['max_rows'])
< $this->properties['unlim_num_rows']
Expand Down Expand Up @@ -909,7 +910,7 @@ private function getMoveForwardButtonsForTableNavigation(
'&gt;&gt;',
_pgettext('Last page', 'End'),
@((int) ceil(
$this->properties['unlim_num_rows']
(int) $this->properties['unlim_num_rows']
/ $_SESSION['tmpval']['max_rows']
) - 1) * $maxRows,
$htmlSqlQuery,
Expand Down Expand Up @@ -4095,7 +4096,7 @@ private function getBulkLinks(
* sql_query: string,
* single_table?: "true",
* raw_query?: "true",
* unlim_num_rows?: int|numeric-string
* unlim_num_rows?: int|numeric-string|false
* }
* }
*/
Expand Down
2 changes: 1 addition & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5726,12 +5726,12 @@
<code>$sortExpressionNoDirection[$indexInExpression]</code>
<code>$sortExpressionNoDirection[$indexInExpression]</code>
<code>$sqlQuery</code>
<code>$this-&gt;properties['unlim_num_rows'] / $_SESSION['tmpval']['max_rows']</code>
<code>$total</code>
<code>$urlParams['where_clause']</code>
<code>$whereClause</code>
<code>$whereClause</code>
<code>$whereClauseMap[$rowNumber][$meta-&gt;orgtable]</code>
<code>(int) $this-&gt;properties['unlim_num_rows'] / $_SESSION['tmpval']['max_rows']</code>
<code>empty($field-&gt;database) ? $this-&gt;properties['db'] : $field-&gt;database</code>
</MixedArgument>
<MixedArgumentTypeCoercion occurrences="6">
Expand Down

0 comments on commit bc58521

Please sign in to comment.