Author Topic: "Create user from contact" not work  (Read 5809 times)

athicom

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
"Create user from contact" not work
« on: November 15, 2008, 11:03:49 am »
Hi,
I use version 1.0, and i learning to use OpenGoo.
I found any Bug, is "Create user from contact" not work!

Thank for good Project
 ;)

athicom

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: "Create user from contact" not work
« Reply #1 on: November 15, 2008, 11:07:08 am »
When go to New user page in Username textbox show value = "<span id="

Thank.

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: "Create user from contact" not work
« Reply #2 on: November 15, 2008, 05:18:40 pm »
Hi athicom,

Try setting DEBUG as true in 'config/config.php' and see if any error messages are displayed. Also you should check the error log in 'cache/log.php'.

Thanks.

athicom

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: "Create user from contact" not work
« Reply #3 on: November 16, 2008, 12:43:32 am »
Hi ignacio,
for this error not show log in 'cache/log.php'.

Thank.

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: "Create user from contact" not work
« Reply #4 on: November 16, 2008, 10:37:23 am »
What language are you using? This could be caused by an invalid character in one of the translation files.

athicom

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: "Create user from contact" not work
« Reply #5 on: November 17, 2008, 05:22:55 am »
Hi ignacio,

Thank for you answer, i use Thai language, and this error picture.

Thank

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: "Create user from contact" not work
« Reply #6 on: November 17, 2008, 09:11:58 am »
Try changing the language to en_us, only to test if it's due to an invalid character in the translation files. If it works ok in english then you will need to check that the files are saved in UTF8 encoding and that they don't have invalid characters.

If not we'll investigate this a little more.

Thanks.

athicom

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: "Create user from contact" not work
« Reply #7 on: November 18, 2008, 05:18:48 am »
Hi ignacio,
I have answer of this error, when i create contact by name of contact is Thai language and i Create user from this contact, it error.
How can i fix it?

Thank

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: "Create user from contact" not work
« Reply #8 on: November 18, 2008, 09:15:57 am »
I'm not sure whether this will help, but try adding this at the beginning of 'application/layouts/website.php':

Code: [Select]
<?php header ("Content-Type: text/html; charset=utf8"true); ?>

athicom

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: "Create user from contact" not work
« Reply #9 on: November 18, 2008, 12:27:41 pm »
Hi ignacio,

OK i can fixed it.. :D
I replace line 72
"'username' => substr($contact->getFirstname(),0,1) . $contact->getLastname(),"
with
"'username' => $contact->getFirstname() . ' ' . $contact->getLastname()," in file "UserController.class.php"

Error from function substr.  :(

Thank you  ;)
« Last Edit: November 18, 2008, 12:47:08 pm by athicom »

athicom

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: "Create user from contact" not work
« Reply #10 on: November 18, 2008, 12:35:45 pm »
Final,

function substr have problem with utf-8 if use Thai language,
function return eror string.  ???

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: "Create user from contact" not work
« Reply #11 on: November 19, 2008, 01:11:48 pm »
Do you have the mbstring extension installed? I think it may be needed for languages that use non ascii characters.

You can check if you have it with the phpinfo() function. Just put a PHP file in your server that contains:

Code: [Select]
<?php phpinfo() ?>
and look for mbstring

 

anything