Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Upgrade jomsocial 4 errors

10 years 1 week ago
Licenses:

Hi Luis,

please check it, I edit this file:
/components/com_community/libraries/fields/country.php at line 73. I changing the code from

// build an array with TRANSLATED country names as keys...
foreach($countries->country as $country){
    $countriesSorted[JText::_($country->name)] = $country->name;
}

// ...so it can be properly key-value natural-sorted
uasort($countriesSorted, 'CStringHelper::compareAscii');
?>

<select id="field<?php echo $field->id;?>" name="field<?php echo $field->id;?>" class="joms-select" <?php echo $required;?> >
    <option value=""<?php echo empty($field->value) ? ' selected="selected"' : '';?>><?php echo JText::_('COM_COMMUNITY_SELECT_A_COUNTRY');?></option>
<?php
foreach($countriesSorted as $countryName=>$countryCode)
{
?>
    <option value="<?php echo $countryCode;?>"<?php echo ($field->value == $countryCode) ? ' selected="selected"' : '';?>><?php echo $countryName;?></option>
<?php
}
?>
</select>
to
// build an array with TRANSLATED country names as keys...
foreach($countries->country as $country){
    $name = (string) $country->name;
    $countriesSorted[$name] = JText::_($name);
}

// ...so it can be properly key-value natural-sorted
uasort($countriesSorted, 'CStringHelper::compareAscii');
?>

<select id="field<?php echo $field->id;?>" name="field<?php echo $field->id;?>" class="joms-select" <?php echo $required;?> >
    <option value=""<?php echo empty($field->value) ? ' selected="selected"' : '';?>><?php echo JText::_('COM_COMMUNITY_SELECT_A_COUNTRY');?></option>
<?php
foreach($countriesSorted as $countryCode=>$countryName)
{
?>
    <option value="<?php echo $countryCode;?>"<?php echo ($field->value == $countryCode) ? ' selected="selected"' : '';?>><?php echo $countryName;?></option>
<?php
}
?>
</select>

Regards

The following user(s) said Thank You: Kerstin, Luis D
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW