From 8f1635d8fd565354e77b58f94cea4e44d467b048 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 30 Jun 2020 05:49:22 +0000 Subject: [PATCH 1/2] Fix database error ""Unknown column 'parent-item.author-id'" --- src/Model/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 887072eb85..636a98ae4f 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -787,7 +787,7 @@ class Item $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`"; } From 6aadb6b92349e4d40f67b40b9cc7c0ea1e408a5f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 30 Jun 2020 17:51:03 +0000 Subject: [PATCH 2/2] Changed structure --- src/Model/Item.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 636a98ae4f..4228d1a5af 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -789,10 +789,10 @@ class Item 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`"; - } - 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`"; + 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`"; + } } return $joins;