Merge pull request #8832 from annando/fix-db-error

Fix database error ""Unknown column 'parent-item.author-id'"
This commit is contained in:
Hypolite Petovan 2020-06-30 14:55:52 -04:00 committed by GitHub
commit b9873a88a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -787,12 +787,12 @@ class Item
$joins .= " LEFT JOIN `permissionset` ON `permissionset`.`id` = `item`.`psid`"; $joins .= " LEFT JOIN `permissionset` ON `permissionset`.`id` = `item`.`psid`";
} }
if ((strpos($sql_commands, "`parent-item`.") !== false) || (strpos($sql_commands, "`parent-author`.") !== false)) { if ((strpos($sql_commands, "`parent-item`.") !== false) || (strpos($sql_commands, "`parent-item-author`.") !== false)) {
$joins .= " STRAIGHT_JOIN `item` AS `parent-item` ON `parent-item`.`id` = `item`.`parent`"; $joins .= " STRAIGHT_JOIN `item` AS `parent-item` ON `parent-item`.`id` = `item`.`parent`";
}
if (strpos($sql_commands, "`parent-item-author`.") !== false) { if (strpos($sql_commands, "`parent-item-author`.") !== false) {
$joins .= " STRAIGHT_JOIN `contact` AS `parent-item-author` ON `parent-item-author`.`id` = `parent-item`.`author-id`"; $joins .= " STRAIGHT_JOIN `contact` AS `parent-item-author` ON `parent-item-author`.`id` = `parent-item`.`author-id`";
}
} }
return $joins; return $joins;