mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/11103] Instantiate $phpbb_notifications as needed
https://github.com/phpbb/phpbb3/pull/992#discussion_r2413976 PHPBB3-11103
This commit is contained in:
@@ -1410,8 +1410,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
|
||||
*/
|
||||
function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true, $update_search_index = true)
|
||||
{
|
||||
global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path;
|
||||
global $phpbb_notifications;
|
||||
global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container;
|
||||
|
||||
// We do not handle erasing posts here
|
||||
if ($mode == 'delete')
|
||||
@@ -2231,6 +2230,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
'post_subject' => $subject,
|
||||
));
|
||||
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
if ($post_approval)
|
||||
{
|
||||
switch ($mode)
|
||||
@@ -2282,6 +2283,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
case 'edit':
|
||||
case 'edit_last_post':
|
||||
$phpbb_notifications->delete_notifications('topic', $data['topic_id']);
|
||||
|
||||
$phpbb_notifications->delete_notifications(array(
|
||||
'quote',
|
||||
'bookmark',
|
||||
|
Reference in New Issue
Block a user