From 2c6c6579af42104833beded31f119c50e74cc810 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 22 Mar 2020 09:57:46 +0000 Subject: [PATCH 1/3] Issue 8371: Enhanced logging for picture problem --- src/Model/Photo.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 34fd37a9de..dd6fe52899 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -662,6 +662,13 @@ class Photo 'resource-id' => $image_rid, 'uid' => $uid ]; if (!Photo::exists($condition)) { + $condition = ['resource-id' => $image_rid]; + $photo = Photo::selectFirst(['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'uid'], $condition); + if (!DBA::isResult($photo)) { + Logger::info('Image not found', ['condition' => $condition]); + } else { + Logger::info('Mismatching permissions', ['condition' => $condition, 'photo' => $photo]); + } continue; } From f8d20b365fce3ff4951086810db81ed9027e4904 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 22 Mar 2020 09:59:06 +0000 Subject: [PATCH 2/3] We should use "self" --- src/Model/Photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Photo.php b/src/Model/Photo.php index dd6fe52899..b5d1ea8942 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -663,7 +663,7 @@ class Photo ]; if (!Photo::exists($condition)) { $condition = ['resource-id' => $image_rid]; - $photo = Photo::selectFirst(['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'uid'], $condition); + $photo = self::selectFirst(['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'uid'], $condition); if (!DBA::isResult($photo)) { Logger::info('Image not found', ['condition' => $condition]); } else { From 505aa95c3dfc0db6aa34ed4b4380d2b07f10e178 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 22 Mar 2020 10:05:52 +0000 Subject: [PATCH 3/3] Fixed wrong contact permisssion --- mod/item.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mod/item.php b/mod/item.php index 99251a4a47..ba79d507b2 100644 --- a/mod/item.php +++ b/mod/item.php @@ -264,10 +264,10 @@ function item_post(App $a) { } else { $aclFormatter = DI::aclFormatter(); - $str_group_allow = isset($_REQUEST['group_allow']) ? $aclFormatter->toString($_REQUEST['group_allow']) : $user['allow_gid'] ?? ''; - $str_contact_allow = isset($_REQUEST['contact_allow']) ? $aclFormatter->toString($_REQUEST['contact__allow']) : $user['allow_cid'] ?? ''; - $str_group_deny = isset($_REQUEST['group_deny']) ? $aclFormatter->toString($_REQUEST['group_deny']) : $user['deny_gid'] ?? ''; - $str_contact_deny = isset($_REQUEST['contact_deny']) ? $aclFormatter->toString($_REQUEST['contact_deny']) : $user['deny_cid'] ?? ''; + $str_group_allow = isset($_REQUEST['group_allow']) ? $aclFormatter->toString($_REQUEST['group_allow']) : $user['allow_gid'] ?? ''; + $str_contact_allow = isset($_REQUEST['contact_allow']) ? $aclFormatter->toString($_REQUEST['contact_allow']) : $user['allow_cid'] ?? ''; + $str_group_deny = isset($_REQUEST['group_deny']) ? $aclFormatter->toString($_REQUEST['group_deny']) : $user['deny_gid'] ?? ''; + $str_contact_deny = isset($_REQUEST['contact_deny']) ? $aclFormatter->toString($_REQUEST['contact_deny']) : $user['deny_cid'] ?? ''; $title = Strings::escapeTags(trim($_REQUEST['title'] ?? '')); $location = Strings::escapeTags(trim($_REQUEST['location'] ?? ''));