Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9944

Extension groups naming don't use users' language in ACP

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.8
    • Fix Version/s: 3.0.9-RC1
    • Component/s: ACP
    • Labels:
      None

      Description

      The bug is a regression of PHPBB3-7717.
      After we have changed extension groups naming to be using urers' language, schema_data hasn't been changed to reflect that improvement.

      On vanilla 3.0.8 installations we have extension groups named as EXT_GROUPS_IMAGES and so on in ACP/Manage extensions.

      It can be fixed by replacement in schema_data.sql

      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('{L_EXT_GROUP_IMAGES}', 1, 1, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('{L_EXT_GROUP_ARCHIVES}', 0, 1, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('{L_EXT_GROUP_PLAIN_TEXT}', 0, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('{L_EXT_GROUP_DOCUMENTS}', 0, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('{L_EXT_GROUP_REAL_MEDIA}', 3, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('{L_EXT_GROUP_WINDOWS_MEDIA}', 2, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('{L_EXT_GROUP_FLASH_FILES}', 5, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('{L_EXT_GROUP_QUICKTIME_MEDIA}', 6, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('{L_EXT_GROUP_DOWNLOADABLE_FILES}', 0, 0, 1, '', 0, '');

      with

      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('IMAGES', 1, 1, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('ARCHIVES', 0, 1, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('PLAIN_TEXT', 0, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('DOCUMENTS', 0, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('REAL_MEDIA', 3, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('WINDOWS_MEDIA', 2, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('FLASH_FILES', 5, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('QUICKTIME_MEDIA', 6, 0, 1, '', 0, '');
      INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('DOWNLOADABLE_FILES', 0, 0, 1, '', 0, '');

        Issue Links

          Activity

          Show
          narqelion narqelion [X] (Inactive) added a comment - For reference: http://www.phpbb.com/community/viewtopic.php?p=12913473#p12913473
          Hide
          leviatan21 leviatan21 [X] (Inactive) added a comment - - edited

          The error are in the file root/includes/acp/acp_atachments

           
          ----
          Line : 93
          					$row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'];
          ----
          Line : 559
          						$group_name = (isset($user->lang['EXT_GROUP_' . $group_name])) ? $user->lang['EXT_GROUP_' . $group_name] : $group_name;
          ----
          Line : 867
          						'GROUP_NAME'	=> (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'],
          ----
          Line : 1127
          			$row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'];
          

          Is because we are checking the existence of the string in the language but adding EXT_GROUP_ to the group_name.
          It leave a string like EXT_GROUP_EXT_GROUP_IMAGES

          My suggestion is add a new check like this : (example for the line 1127)

          			$row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : ((isset($user->lang[$row['group_name']])) ? $user->lang[$row['group_name']] : $row['group_name']);
          

          Or change the code to make only one check :

          			$row['group_name'] = (isset($user->lang[$row['group_name']])) ? $user->lang[$row['group_name']] : $row['group_name'];
          

          Show
          leviatan21 leviatan21 [X] (Inactive) added a comment - - edited The error are in the file root/includes/acp/acp_atachments ---- Line : 93 $row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name']; ---- Line : 559 $group_name = (isset($user->lang['EXT_GROUP_' . $group_name])) ? $user->lang['EXT_GROUP_' . $group_name] : $group_name; ---- Line : 867 'GROUP_NAME' => (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'], ---- Line : 1127 $row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name']; Is because we are checking the existence of the string in the language but adding EXT_GROUP_ to the group_name. It leave a string like EXT_GROUP_EXT_GROUP_IMAGES My suggestion is add a new check like this : (example for the line 1127) $row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : ((isset($user->lang[$row['group_name']])) ? $user->lang[$row['group_name']] : $row['group_name']); Or change the code to make only one check : $row['group_name'] = (isset($user->lang[$row['group_name']])) ? $user->lang[$row['group_name']] : $row['group_name'];
          Hide
          nickvergessen Joas Schilling added a comment -

          no, the real error is, that we forgot to change the install schema-file.
          But your Code could be used as a work around for upcoming support requests.

          Show
          nickvergessen Joas Schilling added a comment - no, the real error is, that we forgot to change the install schema-file. But your Code could be used as a work around for upcoming support requests.
          Hide
          leviatan21 leviatan21 [X] (Inactive) added a comment - - edited

          @Joas Schilling

          In fact you do it at updating from version 3.0.7-PL1, look at the code in file database_update.php

          from line 1657 trough 1780, mainly at this

          						if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0)
          						{
          							continue;
          						}
           
          						$sql_ary = array(
          							'group_name'	=> substr($lang_key, 10), // Strip off 'EXT_GROUP_'
          						);
          
          

          I think this doesn't work because the database is updated before the language file

          Show
          leviatan21 leviatan21 [X] (Inactive) added a comment - - edited @Joas Schilling In fact you do it at updating from version 3.0.7-PL1, look at the code in file database_update.php from line 1657 trough 1780, mainly at this if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0) { continue; }   $sql_ary = array( 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_' ); I think this doesn't work because the database is updated before the language file
          Hide
          Oleg Oleg [X] (Inactive) added a comment -

          Tested fresh install and update from 3.0.8.

          Show
          Oleg Oleg [X] (Inactive) added a comment - Tested fresh install and update from 3.0.8.

            People

            • Assignee:
              nickvergessen Joas Schilling
              Reporter:
              rxu Ruslan Uzdenov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development