Registration page language selection is empty on a single-language board

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
smanst3r
Registered User
Posts: 11
Joined: Wed Oct 07, 2020 11:55 am
Name: Pavlo

Registration page language selection is empty on a single-language board

Post by smanst3r »

I have only one language pack installed (British English), and the default language is also set to en in the ACP.
However, on the registration page, the language selection dropdown is empty.
I believe the issue is caused by the following code in ucp_register.php:

Code: Select all

// Checking amount of available languages
		$sql = 'SELECT lang_iso, lang_local_name
			FROM ' . LANG_TABLE . '
			ORDER BY lang_english_name';
		$result = $db->sql_query($sql);
		$lang_row = (array) $db->sql_fetchrowset($result);
		$db->sql_freeresult($result);
Since I have only one language installed, count($lang_row) returns 1.
Later in the template variables:

Code: Select all

$template_vars = array(
...
'S_LANG_OPTIONS'	=> (count($lang_row) > 1) ? language_select($data['lang'], $lang_row) : '', // Here is the issue I suppose
Because count($lang_row) is 1, the S_LANG_OPTIONS variable is set to an empty string, which likely removes the dropdown from the registration page.

Is this the intended behavior? If not, what would be the best way to ensure the default language is selected properly even when there's only one language installed?

Thanks!
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53631
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Registration page language selection is empty on a single-language board

Post by Brf »

There is no need to select a language if there is only one in the list. That one would always be chosen.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6724
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Registration page language selection is empty on a single-language board

Post by thecoalman »

There shouldn't be language selection available at all if you only have one language installed. Are you using Prosilver or custom style?
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
smanst3r
Registered User
Posts: 11
Joined: Wed Oct 07, 2020 11:55 am
Name: Pavlo

Re: Registration page language selection is empty on a single-language board

Post by smanst3r »

Thanks for the feedback. I am using prosilver Quarto Asphalt Light style
smanst3r
Registered User
Posts: 11
Joined: Wed Oct 07, 2020 11:55 am
Name: Pavlo

Re: Registration page language selection is empty on a single-language board

Post by smanst3r »

Language select on the screenshot
Screenshot from 2025-03-07 10-53-13.png
You do not have the required permissions to view the files attached to this post.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72732
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK

Re: Registration page language selection is empty on a single-language board

Post by KevC »

Try prosilver.

With a standard installation of one language it should look like this
You do not have the required permissions to view the files attached to this post.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
User avatar
Madalin10
Registered User
Posts: 143
Joined: Wed Jun 18, 2014 2:42 pm
Name: Madalin C.

Re: Registration page language selection is empty on a single-language board

Post by Madalin10 »

smanst3r wrote: Fri Mar 07, 2025 8:54 am Language select on the screenshot
Screenshot from 2025-03-07 10-53-13.png
That's a bug from the style you are using. It is just not up-to-date with the phpbb version.
https://awesome-web.design - phpBB & web design services at fair prices. Recommended and trusted by many clients.
smanst3r
Registered User
Posts: 11
Joined: Wed Oct 07, 2020 11:55 am
Name: Pavlo

Re: Registration page language selection is empty on a single-language board

Post by smanst3r »

Thank you, that should help
User avatar
Madalin10
Registered User
Posts: 143
Joined: Wed Jun 18, 2014 2:42 pm
Name: Madalin C.

Re: Registration page language selection is empty on a single-language board

Post by Madalin10 »

You can copy the "/template/ucp_register.html" file from prosilver to your style template folder, clear cache and see then how it looks.

Or if you search inside your style in the ucp_register.html file:

For: <!-- EVENT ucp_register_options_before -->

After that event the code should look like this:

Code: Select all

{% if S_LANG_OPTIONS %}
	<dl>
		<dt><label for="lang">{{ lang('LANGUAGE') ~ lang('COLON') }}</label></dt>
		<dd><select name="lang" id="lang" onchange="change_language(this.value); return false;" tabindex="6" title="{{ lang('LANGUAGE') }}">{{ S_LANG_OPTIONS }}</select></dd>
	</dl>
{% endif %}
https://awesome-web.design - phpBB & web design services at fair prices. Recommended and trusted by many clients.

Return to “[3.3.x] Support Forum”