From e7f124b8ce7f483bfbeed4c3aabe43c96d1060cb Mon Sep 17 00:00:00 2001 From: brunoais Date: Thu, 3 Jul 2014 15:11:19 +0100 Subject: [PATCH 1/4] [ticket/12801] Add topic_poster to load_drafts' topics query PHPBB3-12801 --- phpBB/includes/functions_posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 0b37af0ee0..d728396524 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -936,7 +936,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms $topic_rows = array(); if (sizeof($topic_ids)) { - $sql = 'SELECT topic_id, forum_id, topic_title + $sql = 'SELECT topic_id, forum_id, topic_title, topic_poster FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', array_unique($topic_ids)); $result = $db->sql_query($sql); From 4629ebfc4ff95c61069c271e7b77102a77b7a761 Mon Sep 17 00:00:00 2001 From: brunoais Date: Thu, 3 Jul 2014 15:11:46 +0100 Subject: [PATCH 2/4] [ticket/12801] Add core.functions_posting.load_drafts_draft_list_results Adding event core.functions_posting.load_drafts_draft_list_results PHPBB3-12801 --- phpBB/includes/functions_posting.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index d728396524..913071ec4f 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -947,6 +947,20 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms } $db->sql_freeresult($result); } + + /** + * Drafts found and their topics + * Edit $draft_rows in order to add or remove drafts loaded + * + * @event core.functions_posting.load_drafts_draft_list_results + * @var array draft_rows The drafts query result. Includes its forum id and everything about the draft + * @var array topic_ids The list of topics got from the topics table + * @var array topic_rows The topics that draft_rows references + * @since 3.1.0-RC2 + */ + $vars = array('draft_rows', 'topic_ids', 'topic_rows'); + extract($phpbb_dispatcher->trigger_event('core.functions_posting.load_drafts_draft_list_results', compact($vars))); + unset($topic_ids); $template->assign_var('S_SHOW_DRAFTS', true); From acaa1fe59c638f327f7e5a8d18d847e1e10a1c3f Mon Sep 17 00:00:00 2001 From: brunoais Date: Sun, 20 Jul 2014 09:19:23 +0100 Subject: [PATCH 3/4] [ticket/12801] missing $phpbb_dispatcher as a global PHPBB3-12801 --- phpBB/includes/functions_posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 913071ec4f..b4db785c61 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -893,7 +893,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $msg_id = 0) { global $user, $db, $template, $auth; - global $phpbb_root_path, $phpEx; + global $phpbb_root_path, $phpbb_dispatcher, $phpEx; $topic_ids = $forum_ids = $draft_rows = array(); From 47bfe2999d081a6b83ab1441a59165d720030318 Mon Sep 17 00:00:00 2001 From: brunoais Date: Fri, 1 Aug 2014 11:12:29 +0100 Subject: [PATCH 4/4] [ticket/12801] Changed name change @since as requested Changed name to core.load_drafts_draft_list_result as requested Changed @since to 3.1.0-RC3 because RC2 is already out. PHPBB3-12801 --- phpBB/includes/functions_posting.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index b4db785c61..65d858785a 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -952,14 +952,14 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms * Drafts found and their topics * Edit $draft_rows in order to add or remove drafts loaded * - * @event core.functions_posting.load_drafts_draft_list_results + * @event core.load_drafts_draft_list_result * @var array draft_rows The drafts query result. Includes its forum id and everything about the draft * @var array topic_ids The list of topics got from the topics table * @var array topic_rows The topics that draft_rows references - * @since 3.1.0-RC2 + * @since 3.1.0-RC3 */ $vars = array('draft_rows', 'topic_ids', 'topic_rows'); - extract($phpbb_dispatcher->trigger_event('core.functions_posting.load_drafts_draft_list_results', compact($vars))); + extract($phpbb_dispatcher->trigger_event('core.load_drafts_draft_list_result', compact($vars))); unset($topic_ids);