From 3c632fa8e4af4b9b666ddbab2de77d42716ce2b2 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 13:14:51 +0200 Subject: [PATCH] [ticket/11842] Use group_id 0 and correct avatar name after creating group It seems like the function group_correct_avatar() was forgotten while adding the new avatar system. We now pass the group_id 0 to the upload avatar and let the function group_correct_avatar() fix the avatar filename after creating the group like it was done previously. PHPBB3-11842 --- phpBB/includes/acp/acp_groups.php | 4 ++++ phpBB/includes/functions_user.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index ad29a5521b..e0f2e0ed8d 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -325,6 +325,10 @@ class acp_groups // This is normalised data, without the group_ prefix $avatar_data = \phpbb\avatar\manager::clean_row($group_row); + if (!isset($avatar_data['id'])) + { + $avatar_data['id'] = $group_id; + } } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 30891c3fb5..475f59da1d 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2314,7 +2314,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow { $group_id = $db->sql_nextid(); - if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == AVATAR_UPLOAD) + if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == 'avatar.driver.upload') { group_correct_avatar($group_id, $sql_ary['group_avatar']); }