Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/12331] Fix SQL error when inserting a new entry to profile field... #2215

Merged
merged 2 commits into from
Apr 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions phpBB/phpbb/profilefields/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ public function update_profile_field_data($user_id, $cp_data)

if (!$this->db->sql_affectedrows())
{
$cp_data = $this->build_insert_sql_array($cp_data);
$cp_data['user_id'] = (int) $user_id;

$this->db->sql_return_on_error(true);
Expand Down
33 changes: 33 additions & 0 deletions tests/functional/ucp_profile_test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
*
* @package testing
* @copyright (c) 2014 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

/**
* @group functional
*/
class phpbb_functional_ucp_profile_test extends phpbb_functional_test_case
{
public function test_submitting_profile_info()
{
$this->add_lang('ucp');
$this->login();

$crawler = self::request('GET', 'ucp.php?i=ucp_profile&mode=profile_info');
$this->assertContainsLang('UCP_PROFILE_PROFILE_INFO', $crawler->filter('#cp-main h2')->text());

$form = $crawler->selectButton('Submit')->form(array(
'pf_phpbb_location' => 'Bertie´s Empire',
));
$crawler = self::submit($form);
$this->assertContainsLang('PROFILE_UPDATED', $crawler->filter('#message')->text());

$crawler = self::request('GET', 'ucp.php?i=ucp_profile&mode=profile_info');
$form = $crawler->selectButton('Submit')->form();
$this->assertEquals('Bertie´s Empire', $form->get('pf_phpbb_location')->getValue());
}
}