aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-11-14 19:06:42 +0100
committerJoas Schilling <nickvergessen@gmx.de>2012-11-14 19:06:42 +0100
commit60d831c392a78fceb4ae737a3141573c4b2427d8 (patch)
tree9b84df7a5dbc127ce36e8320fcf010fe4bafba7f /phpBB/includes/functions_user.php
parent59bb498de7025a54c28f0442d994ab1d23e1cce7 (diff)
downloadforums-60d831c392a78fceb4ae737a3141573c4b2427d8.tar
forums-60d831c392a78fceb4ae737a3141573c4b2427d8.tar.gz
forums-60d831c392a78fceb4ae737a3141573c4b2427d8.tar.bz2
forums-60d831c392a78fceb4ae737a3141573c4b2427d8.tar.xz
forums-60d831c392a78fceb4ae737a3141573c4b2427d8.zip
[ticket/10411] Fix logic error when editing/creating a group
PHPBB3-10411
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 3005f5efda..33b62fe8b8 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -2570,7 +2570,7 @@ function phpbb_avatar_explanation_string()
*/
function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false)
{
- global $phpbb_root_path, $config, $db, $user, $file_upload;
+ global $phpbb_root_path, $config, $db, $user, $file_upload, $phpbb_container;
$error = array();
@@ -2602,8 +2602,6 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
$current_legend = phpbb_groupposition_legend::GROUP_DISABLED;
$current_teampage = phpbb_groupposition_teampage::GROUP_DISABLED;
- global $phpbb_container;
-
$legend = $phpbb_container->get('groupposition.legend');
$teampage = $phpbb_container->get('groupposition.teampage');
if ($group_id)
@@ -2731,6 +2729,13 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
$db->sql_query($sql);
}
+ // Remove the group from the teampage, only if unselected and we are editing a group,
+ // which is currently displayed.
+ if (!$group_teampage && $group_id && $current_teampage != phpbb_groupposition_teampage::GROUP_DISABLED)
+ {
+ $teampage->delete_group($group_id);
+ }
+
if (!$group_id)
{
$group_id = $db->sql_nextid();
@@ -2741,6 +2746,11 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
}
}
+ if ($group_teampage && $current_teampage == phpbb_groupposition_teampage::GROUP_DISABLED)
+ {
+ $teampage->add_group($group_id);
+ }
+
if ($group_teampage)
{
if ($current_teampage == phpbb_groupposition_teampage::GROUP_DISABLED)