diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-06-06 14:23:20 -0500 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-06-06 14:23:20 -0500 |
commit | b4b1704a9b2f2c6e7770f478e27c5c408772f3ff (patch) | |
tree | 42246af57eca463d63b9ef52f6c1c242fbcfddba /phpBB/includes | |
parent | 8c3bb26a62ade208d5035015299c2126b15854cb (diff) | |
parent | 495b22632c489f08c46f6712f917e920911e5759 (diff) | |
download | forums-b4b1704a9b2f2c6e7770f478e27c5c408772f3ff.tar forums-b4b1704a9b2f2c6e7770f478e27c5c408772f3ff.tar.gz forums-b4b1704a9b2f2c6e7770f478e27c5c408772f3ff.tar.bz2 forums-b4b1704a9b2f2c6e7770f478e27c5c408772f3ff.tar.xz forums-b4b1704a9b2f2c6e7770f478e27c5c408772f3ff.zip |
Merge remote-tracking branch 'remotes/Marc/ticket/11587' into develop
# By Marc Alexander
# Via Marc Alexander
* remotes/Marc/ticket/11587:
[ticket/11587] Add functional tests for group teampage settings
[ticket/11587] Pass legend and teampage settings to group_create()
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/ucp/ucp_groups.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index efc88e6e37..af08533a7d 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -416,9 +416,11 @@ class ucp_groups if ($group_id) { - $sql = 'SELECT * - FROM ' . GROUPS_TABLE . " - WHERE group_id = $group_id"; + $sql = 'SELECT g.*, t.teampage_position AS group_teampage + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . TEAMPAGE_TABLE . ' t + ON (t.group_id = g.group_id) + WHERE g.group_id = ' . $group_id; $result = $db->sql_query($sql); $group_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -514,6 +516,8 @@ class ucp_groups 'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0, 'message_limit' => request_var('group_message_limit', 0), 'max_recipients'=> request_var('group_max_recipients', 0), + 'legend' => $group_row['group_legend'], + 'teampage' => $group_row['group_teampage'], ); if ($config['allow_avatar']) @@ -569,6 +573,9 @@ class ucp_groups // Only set the rank, colour, etc. if it's changed or if we're adding a new // group. This prevents existing group members being updated if no changes // were made. + // However there are some attributes that need to be set everytime, + // otherwise the group gets removed from the feature. + $set_attributes = array('legend', 'teampage'); $group_attributes = array(); $test_variables = array( @@ -580,13 +587,14 @@ class ucp_groups 'avatar_height' => 'int', 'receive_pm' => 'int', 'legend' => 'int', + 'teampage' => 'int', 'message_limit' => 'int', 'max_recipients'=> 'int', ); foreach ($test_variables as $test => $type) { - if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test] || isset($group_attributes['group_avatar']) && strpos($test, 'avatar') === 0)) + if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test] || isset($group_attributes['group_avatar']) && strpos($test, 'avatar') === 0 || in_array($test, $set_attributes))) { settype($submit_ary[$test], $type); $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; @@ -596,6 +604,7 @@ class ucp_groups if (!($error = group_create($group_id, $group_type, $group_name, $group_desc, $group_attributes, $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies))) { $cache->destroy('sql', GROUPS_TABLE); + $cache->destroy('sql', TEAMPAGE_TABLE); $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; trigger_error($user->lang[$message] . $return_page); |