1
0
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:
Nathan Guse
2012-12-13 19:19:40 -06:00
parent 84284a9cce
commit 249f3c8885
12 changed files with 69 additions and 34 deletions

View File

@@ -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',