diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php index 31244bf957..f96495d2df 100644 --- a/phpBB/phpbb/db/migration/profilefield_base_migration.php +++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php @@ -111,6 +111,36 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration $insert_buffer->flush(); } + /** + * Create Custom profile fields languguage entries + */ + public function create_language_entries() + { + $field_id = $this->get_custom_profile_field_id(); + + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_FIELDS_LANG_TABLE); + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) + { + foreach ($this->profilefield_language_data as $language_data) + { + $insert_buffer->insert(array( + 'field_id' => $field_id, + 'lang_id' => $lang_id, + 'option_id' => $language_data['option_id'], + 'field_type' => $language_data['field_type'], + 'lang_value' => $language_data['lang_value'], + )); + } + } + $this->db->sql_freeresult($result); + + $insert_buffer->flush(); + } + /** * Get custom profile field id * @return int custom profile filed id