Skip to content

Commit

Permalink
Fixed a bug with staticpages in case of PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed May 18, 2021
1 parent 893dd6d commit f27157a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/staticpages/functions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ function plugin_dopluginsearch_staticpages($query, $datestart, $dateend, $topic,

// Search 0 = Excluded, 1 = Default, 2 = Included
// SQL Default for regular pages
$searchsql = '(search = 1 AND sp_centerblock = 0 AND sp_php = 0 AND template_id = "")';
$searchsql = "(search = 1 AND sp_centerblock = 0 AND sp_php = 0 AND template_id = '')";
$searchsqlRemove = '';
if ($_SP_CONF['includesearchcenterblocks']) {
$searchsql .= ' OR (sp_centerblock = 1 AND search = 1)';
Expand All @@ -1030,11 +1030,11 @@ function plugin_dopluginsearch_staticpages($query, $datestart, $dateend, $topic,
}

if ($_SP_CONF['includesearchtemplate']) {
$searchsql .= ' OR (template_id != "" AND search = 1)';
$searchsql .= " OR (template_id <> '' AND search = 1)";
} else {
// Make sure we fully remove template pages
// Since they could be included above since they can also be a center block or have PHP
$searchsqlRemove .= ' AND NOT (template_id != "" AND search = 1)';
$searchsqlRemove .= " AND NOT (template_id <> '' AND search = 1)";
}
// Include all pages marked include and add rest of search sql
$sql .= " AND (search = 2 OR ($searchsql))$searchsqlRemove ";
Expand Down

0 comments on commit f27157a

Please sign in to comment.