Merge pull request #8441 from annando/issue-8371-logging

Issue 8371: Enhanced logging for picture problem
This commit is contained in:
Tobias Diekershoff 2020-03-22 11:48:25 +01:00 committed by GitHub
commit 9f8ca846eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -264,10 +264,10 @@ function item_post(App $a) {
} else { } else {
$aclFormatter = DI::aclFormatter(); $aclFormatter = DI::aclFormatter();
$str_group_allow = isset($_REQUEST['group_allow']) ? $aclFormatter->toString($_REQUEST['group_allow']) : $user['allow_gid'] ?? ''; $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_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_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_contact_deny = isset($_REQUEST['contact_deny']) ? $aclFormatter->toString($_REQUEST['contact_deny']) : $user['deny_cid'] ?? '';
$title = Strings::escapeTags(trim($_REQUEST['title'] ?? '')); $title = Strings::escapeTags(trim($_REQUEST['title'] ?? ''));
$location = Strings::escapeTags(trim($_REQUEST['location'] ?? '')); $location = Strings::escapeTags(trim($_REQUEST['location'] ?? ''));

View file

@ -662,6 +662,13 @@ class Photo
'resource-id' => $image_rid, 'uid' => $uid 'resource-id' => $image_rid, 'uid' => $uid
]; ];
if (!Photo::exists($condition)) { if (!Photo::exists($condition)) {
$condition = ['resource-id' => $image_rid];
$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 {
Logger::info('Mismatching permissions', ['condition' => $condition, 'photo' => $photo]);
}
continue; continue;
} }