Skip to content

Commit 0062407

Browse files
committed
Replace boolean with integer in queries
Better sqlite compatibility
1 parent 659863b commit 0062407

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

_test/AccessTableDataReplacement.test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function test_DataFiltersAsSubQuery($inputFilterLines, $expectedFilterWhe
187187
)
188188
AND (
189189
(IS_PUBLISHER(data_bar.pid) AND data_bar.latest = 1)
190-
OR (IS_PUBLISHER(data_bar.pid) IS FALSE AND data_bar.published = 1)
190+
OR (IS_PUBLISHER(data_bar.pid) !=1 AND data_bar.published = 1)
191191
)";
192192

193193
$expected_where = $baseWhere . $expectedFilterWhere . " )";

_test/mock/helper_plugin_struct_db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class helper_plugin_struct_db extends \helper_plugin_struct_db {
66

77
public function IS_PUBLISHER() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
88
{
9-
return false;
9+
return 0;
1010
}
1111
}

helper/db.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ public function STRUCT_JSON() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.N
121121
/**
122122
* This dummy implementation can be overwritten by a plugin
123123
*
124-
* @return bool
124+
* @return int
125125
*/
126126
public function IS_PUBLISHER() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
127127
{
128-
return true;
128+
return 1;
129129
}
130130
}
131131

meta/Search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ public function getSQL()
476476
$first_table = $datatable;
477477
}
478478
// phpcs:ignore
479-
$QB->filters()->whereAnd("( (IS_PUBLISHER($datatable.pid) AND $datatable.latest = 1) OR (IS_PUBLISHER($datatable.pid) IS FALSE AND $datatable.published = 1) )");
479+
$QB->filters()->whereAnd("( (IS_PUBLISHER($datatable.pid) AND $datatable.latest = 1) OR (IS_PUBLISHER($datatable.pid) !=1 AND $datatable.published = 1) )");
480480
}
481481

482482
// columns to select, handling multis

plugin.info.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
base struct
22
author Andreas Gohr, Michael Große, Anna Dabrowska
33
email dokuwiki@cosmocode.de
4-
date 2022-09-27
4+
date 2022-09-28
55
name struct plugin
66
desc Add and query additional structured page data
77
url https://www.dokuwiki.org/plugin:struct

0 commit comments

Comments
 (0)