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.

Country display error: COM_COMMUNITY_LANG_NAME_

10 years 4 months ago
  • Roland's Avatar
    Topic Author
  • Roland
  • Offline
  • Fresh Boarder
  • Posts: 76
  • Thank you received: 3
Licenses:
JomSocial Expired

I recently updated to the latest Jomsocial pack and now having some language display error.

When adding the code:
$user->getInfo('FIELD_COUNTRY')
then ONLY FOR SOME COUNTRIES (like italy, Trinidad and Tobago etc). I get a malformatted country display preceded with "COM_COMMUNITY_LANG_NAME_"
I am attaching a screenshot.


Joomla 2.5.17
Jomsocial 3.1.0.1

Please help to fix this.
Thanks

Attachments:
10 years 4 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

You try hack the code right? change your code :

$user->getInfo('FIELD_COUNTRY')

to :
JText::_($user->getInfo('FIELD_COUNTRY'))

10 years 4 months ago
  • Roland's Avatar
    Topic Author
  • Roland
  • Offline
  • Fresh Boarder
  • Posts: 76
  • Thank you received: 3
Licenses:
JomSocial Expired

No, that unfortunately does not fix it.

10 years 4 months ago
  • Roland's Avatar
    Topic Author
  • Roland
  • Offline
  • Fresh Boarder
  • Posts: 76
  • Thank you received: 3
Licenses:
JomSocial Expired

OMG! I noticed that Jomsocial SAVES actually the entire COM_COMMUNITY_LANG_NAME_COUNTRY string as the country in the user profile field (community_field_values table).

What the heck!
Please provide a quick fix. this messes up my entire database!
Thank you

10 years 4 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

that is right, we stored the value like this COM_COMMUNITY_LANG_NAME_COUNTRY, only can fixed by adding JText::_() function, please you use this carefully :

$lang = JFactory::getLanguage();
$lang->load( 'com_community.country');
JText::_($user->getInfo('FIELD_COUNTRY'));

10 years 4 months ago
  • Roland's Avatar
    Topic Author
  • Roland
  • Offline
  • Fresh Boarder
  • Posts: 76
  • Thank you received: 3
Licenses:
JomSocial Expired

I don't understand why you changed that. What is now with all my thousands of other users who have the old language format? I tried the advance search and either one or the other shows (although from the same country). UI am really getting nuts with all these bugs.

10 years 4 months ago
  • Roland's Avatar
    Topic Author
  • Roland
  • Offline
  • Fresh Boarder
  • Posts: 76
  • Thank you received: 3
Licenses:
JomSocial Expired

Before I read your response (Thank you for that, Dimas) I fixed it - stupid Jomsocial bug!
People how are you testing the site before offering it for sale for the public?! I fixed now over 5 serious bugs in just 2 days!

For this particular bug, please open the file components/com_community/libraries/fields/country.php,
Instead of JText::_($name) it places just $name in the value tag.
(I tried to copy and paste the code, but this gave me here a server error, so omitted it)
Hopefully others will benefit from it.

However, this only works for the registration. I could not find a way to fix the country when people try to update their profile. Where can I find that file/lines?
Thank you

10 years 4 months ago
  • Roland's Avatar
    Topic Author
  • Roland
  • Offline
  • Fresh Boarder
  • Posts: 76
  • Thank you received: 3
Licenses:
JomSocial Expired

Fixed it - same file! Was maybe a cache issue why I did not see the instant changes in profile update.

10 years 4 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

you turnon the cache, so make sure you clear it first before see the result of any hacks :)

10 years 3 months ago
  • m's Avatar
  • m
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 0
Licenses:
JomSocial Expired

I have this same issue but when went to country.php

I seen the option value is already set to JText::_($name)

<option value="<?php echo $name;?>"<?php echo ($field->value == $name) ? ' selected="selected"' : '';?>><?php echo JText::_($name);?></option>

I found some the other issues with this in the forum and looked some of those suggestions. IE en-GB library page and others.



Any takers???

Will

10 years 3 months ago
  • Roland's Avatar
    Topic Author
  • Roland
  • Offline
  • Fresh Boarder
  • Posts: 76
  • Thank you received: 3
Licenses:
JomSocial Expired

Will,
Please remember: $name is different than JText::_($name).
So in your code you try to compare name with JText::_($name).
This is my solution:
<option value="<?php echo JText::_($name);?>"<?php echo ($field->value == JText::_($name)) ? ' selected="selected"' : '';?> <?php echo (empty($field->value) && JText::_($name)=='United States') ? ' selected="selected"' : '';?>><?php echo JText::_($name);?></option>


I still don't understand this cumbersome country solution Jomsocial came up with. One more thing to make Jomsocial more complicated and less customizable.

I hope that snippet helped.
Roland

10 years 3 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Thank you Ronald for your help...

10 years 3 months ago
  • m's Avatar
  • m
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 0
Licenses:
JomSocial Expired

Nope that didn't help at all it actually hurt.

I run XIUS on my site for member searches. When I placed that code in not only did it not work. But it also negated all the people with the messed up country listing from being in the search. I swapped back out with the original and the users with the problem were all listed again in the search.

10 years 3 months ago
  • Roland's Avatar
    Topic Author
  • Roland
  • Offline
  • Fresh Boarder
  • Posts: 76
  • Thank you received: 3
Licenses:
JomSocial Expired

Will,
Will,
Sorry to hear that it did not work. I assume it's because your site maybe started already with a later version of Jomsocial? My solution was for users who had their sites based on old Jomsocial versions (I can proudly say that I am one of the first JS users - thus still "loyal" despite so many upgrade issues) ;-)

At some point they decided to do this weird country algorithm, which makes everything very complex and complicated. Again, sorry it did not work for your site - I hope it helps others.

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