diff options
author | Dhruv Goel <dhruv.goel92@gmail.com> | 2014-03-20 01:50:17 +0530 |
---|---|---|
committer | Dhruv Goel <dhruv.goel92@gmail.com> | 2014-03-20 01:50:17 +0530 |
commit | 03f6ad544f6754a96278cc74f984202f1c80bc58 (patch) | |
tree | ea16f18503870a2ba68addc221a6bcfdec3dfb13 | |
parent | 2d1e6975b47afb4466f865fc0c285498edefb2b0 (diff) | |
parent | 3ea1ee651c1f600b6104d3d05576e1e9b856874f (diff) | |
download | forums-03f6ad544f6754a96278cc74f984202f1c80bc58.tar forums-03f6ad544f6754a96278cc74f984202f1c80bc58.tar.gz forums-03f6ad544f6754a96278cc74f984202f1c80bc58.tar.bz2 forums-03f6ad544f6754a96278cc74f984202f1c80bc58.tar.xz forums-03f6ad544f6754a96278cc74f984202f1c80bc58.zip |
Merge pull request #2145 from Elsensee/ticket/10590
[ticket/10590] Remove confirmation page after posting
-rw-r--r-- | phpBB/posting.php | 12 | ||||
-rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 20 |
2 files changed, 13 insertions, 19 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 442e1d9782..aee9ba50af 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1213,17 +1213,11 @@ if ($submit || $preview || $refresh) meta_refresh(10, $redirect_url); $message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD']; $message .= (($user->data['user_id'] == ANONYMOUS) ? '' : ' '. $user->lang['POST_APPROVAL_NOTIFY']); + $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>'); + trigger_error($message); } - else - { - meta_refresh(3, $redirect_url); - $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED'; - $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>'); - } - - $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>'); - trigger_error($message); + redirect($redirect_url); } } } diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index d6eb4a632f..c0e58d1104 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -893,9 +893,9 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $message * @param array $additional_form_data Any additional form data to be sent in the request * @param string $expected Lang var of expected message after posting - * @return array|null post_id, topic_id if message is 'POST_STORED' + * @return array|null post_id, topic_id if message is empty */ - public function create_topic($forum_id, $subject, $message, $additional_form_data = array(), $expected = 'POST_STORED') + public function create_topic($forum_id, $subject, $message, $additional_form_data = array(), $expected = '') { $posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}"; @@ -919,9 +919,9 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $message * @param array $additional_form_data Any additional form data to be sent in the request * @param string $expected Lang var of expected message after posting - * @return array|null post_id, topic_id if message is 'POST_STORED' + * @return array|null post_id, topic_id if message is empty */ - public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array(), $expected = 'POST_STORED') + public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array(), $expected = '') { $posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}"; @@ -941,9 +941,9 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $posting_contains * @param array $form_data * @param string $expected Lang var of expected message after posting - * @return array|null post_id, topic_id if message is 'POST_STORED' + * @return array|null post_id, topic_id if message is empty */ - protected function submit_post($posting_url, $posting_contains, $form_data, $expected = 'POST_STORED') + protected function submit_post($posting_url, $posting_contains, $form_data, $expected = '') { $this->add_lang('posting'); @@ -989,13 +989,13 @@ class phpbb_functional_test_case extends phpbb_test_case // contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs) // Instead, I send it as a request with the submit button "post" set to true. $crawler = self::request('POST', $posting_url, $form_data); - $this->assertContainsLang($expected, $crawler->filter('html')->text()); - if ($expected !== 'POST_STORED') + if ($expected !== '') { - return; + $this->assertContainsLang($expected, $crawler->filter('html')->text()); + return null; } - $url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri(); + $url = $crawler->selectLink($form_data['subject'])->link()->getUri(); return array( 'topic_id' => $this->get_parameter_from_link($url, 't'), |