Replace Logger with DI::logger() in mod folder

This commit is contained in:
Art4 2025-01-13 08:56:33 +00:00
parent ace375aacb
commit ef0fe65c07
2 changed files with 8 additions and 8 deletions

View file

@ -56,7 +56,7 @@ function item_post()
*/
if (!$preview && !empty($_REQUEST['post_id_random'])) {
if (DI::session()->get('post-random') == $_REQUEST['post_id_random']) {
Logger::warning('duplicate post');
DI::logger()->warning('duplicate post');
item_post_return(DI::baseUrl(), $return_path);
} else {
DI::session()->set('post-random', $_REQUEST['post_id_random']);
@ -165,7 +165,7 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat
// This enables interaction like starring and saving into folders
if ($toplevel_item['uid'] == 0) {
$stored = Item::storeForUserByUriId($toplevel_item['uri-id'], $post['uid'], ['post-reason' => Item::PR_ACTIVITY]);
Logger::info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $post['uid'], 'stored' => $stored]);
DI::logger()->info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $post['uid'], 'stored' => $stored]);
}
$post['parent'] = $toplevel_item['id'];
@ -197,7 +197,7 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat
$post = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $post_id]);
if (!$post) {
Logger::error('Item couldn\'t be fetched.', ['post_id' => $post_id]);
DI::logger()->error('Item couldn\'t be fetched.', ['post_id' => $post_id]);
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -213,7 +213,7 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat
DI::contentItem()->copyPermissions($post['thr-parent-id'], $post['uri-id'], $post['parent-uri-id']);
}
Logger::debug('post_complete');
DI::logger()->debug('post_complete');
item_post_return(DI::baseUrl(), $return_path);
// NOTREACHED
@ -297,7 +297,7 @@ function item_process(array $post, array $request, bool $preview, string $return
}
if (!empty($post['cancel'])) {
Logger::info('mod_item: post cancelled by addon.');
DI::logger()->info('mod_item: post cancelled by addon.');
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -324,7 +324,7 @@ function item_post_return($baseurl, $return_path)
$json['reload'] = $baseurl . '/' . $_REQUEST['jsreload'];
}
Logger::debug('post_json', ['json' => $json]);
DI::logger()->debug('post_json', ['json' => $json]);
System::jsonExit($json);
}
@ -444,7 +444,7 @@ function drop_item(int $id, string $return = ''): string
item_redirect_after_action($item, $return);
//NOTREACHED
} else {
Logger::warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'uid' => $item['uid'], 'cid' => $contact_id]);
DI::logger()->warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'uid' => $item['uid'], 'cid' => $contact_id]);
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('display/' . $item['guid']);
//NOTREACHED

View file

@ -277,7 +277,7 @@ function photos_post()
}
if (!empty($_POST['rotate']) && (intval($_POST['rotate']) == 1 || intval($_POST['rotate']) == 2)) {
Logger::debug('rotate');
DI::logger()->debug('rotate');
$photo = Photo::getPhotoForUser($page_owner_uid, $resource_id);