Blank views in non-English locales

Hello,
I have encountered a strange problem while working with SuiteCRM v 7.2.1. After login the system in non-English locale, for example in Russian and going to, let’s say, “Opportunities” tab everything goes well. However when I try to choose one of Opportunity records previously created system returns blank page in chrome and null in IE.
When I first got the issue I logged out and try to do the same step in English locale - the problem was gone, everything was displayed correctly. After that I logged out/logged in with Russian locale and again the issue occurred. I tried other views: Contacts, Counteragents - all the same - List view was fine but Detail View was blank in all cases. Then in list view of Opportunities I clicked Edit button against one of the records and edit window was displayed without any problems. In the edit window I pushed Save and Detailed View appeared with no issues as well and that was strange for I could not understand why the same Detail View could be evoked through its edit window and could not be evoked through list view. After all this manipulations I switched on debug level and tried to repeat the steps and when I chose one of the records from Opportunities list view the system returned error that was started with :
Warning: json_encode(): Invalid UTF-8 sequence in argument occurred in C:\inetpub\wwwroot\php\suitecrm\include\JSON.php on line 72 [2015-04-22 09:24:38] display_stack_trace caller, file: C:\inetpub\wwwroot\php\suitecrm\include\utils.php line#: 3254
L:
C:\inetpub\wwwroot\php\suitecrm\include\JSON.phpL:72
C:\inetpub\wwwroot\php\suitecrm\include\MVC\View\SugarView.phpL:196
C:\inetpub\wwwroot\php\suitecrm\include\MVC\Controller\SugarController.phpL:348
C:\inetpub\wwwroot\php\suitecrm\include\MVC\Controller\SugarController.phpL:295
C:\inetpub\wwwroot\php\suitecrm\include\MVC\SugarApplication.phpL:92
C:\inetpub\wwwroot\php\suitecrm\index.phpL:49

Please could someone helps me to solve the problem!

1 Like

Hi Nicklong,

i found problems with $json->encode too.

I receive Undefined errors. See here:
https://suitecrm.com/forum/developer-help/4809-undefined-message-permissions-are-ok#18209

I haven’t found a solution yet.

Hi Nick,

you are probably on PHP version 5.5 that has stricter checks on the input of the json_encode() function. Downgrading to PHP 5.4 would be a solution.

To analyse and resolve the problem for PHP 5.5, I’d suggest you try out some debugging code and edit

include/MVC/View/SugarView.php

and replace (line 196)

echo $json->encode($ajax_ret);

by


if (!mb_detect_encoding(implode (' ', $ajax_ret ), 'UTF-8', true) )
{
    echo '<pre>';
    print_r($ajax_ret);
    echo '</pre>';
    die ('JSON encoding error');
}
else
    echo $json->encode($ajax_ret);

Tell us what you see on the screen.

Hello All,
Jan, thank you for your reply. I will try to downgrade to older version of PHP. However I consider it as a temporary solution.
Actually after my first post in this topic I tried to investigate the problem myself and found out that some characters in string that was passed to json-encode function were replaced with “?” symbol. Further investigations helped me to localize one of the problems:
Function “strtolower” could not digest any UTF8 symbols (at least Russian). I found out this while trying to check the input and output values of the function.
The solution was to replace “strtolower” with “mb_strtolower”. I made this replacement in several places
In public function getWidgetId($buttonSuffix = true) (line 99) of SugarWidgetSubPanelTopButton.php
and
In two lines (line 76 and 80) in function display($defines) of SugarWidgetSubPanelTopArchiveEmailButton.php

After the manipulations the input string of json-encode function was almost correct, except one row. And for now I cannot find the php file that forms the “securitygroups” subpanel and particularly innerHTML value of tag:
<a href=“javascript:sub_p_rem(‘securitygroups’, ‘SecurityGroups’, ‘563da86c-9e86-519a-33c6-5534bb021e9a’, 0);” class="listViewTdToolsS1"id=securitygroups_remove_1 onclick=“return sp_rem_conf();”>

Best regards,
Nick

Hi Nick,

You’re right about the temporary solution downgrading PHP to 5.4: support ends on 14 Sept. 2015

It would be great to solve this issue. The code you couldn’t find is in line 113 of the file

include/generic/SugarWidgets/SugarWidgetSubPanelRemoveButton.php

Hi Nick,

in case you haven’t solved the problem yet, the unsolved issue is probably caused by a strtolower call in the file:


include/generic/SugarWidgets/SugarWidgetSubPanelRemoveButton.php

You might want to try to replace the strtolower by mb_strtolower in this line 107:


		$icon_remove_text = strtolower($app_strings['LBL_ID_FF_REMOVE']);

Hi Jan!
Thanks a lot! With your help I finally have brought the problem down.
However, I think you forgot one detail:
$icon_remove_text = mb_strtolower($app_strings[‘LBL_ID_FF_REMOVE’]); will not work with out encoding type as a second parameter:
$icon_remove_text = mb_strtolower($app_strings[‘LBL_ID_FF_REMOVE’],“UTF-8”);

For now as the problem solved locally the question about updates and new releases still remains

Hi Nick,

you might want to consider creating a “pull request” on:

https://github.com/salesagility/SuiteCRM

You would need to

  • create a GitHub account
  • create a fork from the repository
  • make the changes in the files
  • create a Pull Request
  • accept the contributor license agreement

You can do all this online without having to install the programm “git” locally.

When your pull request is accepted, then the changes you suggested will be included in future versions.

1 Like

I have a similar problem, but not the technical skills to solve it.

As I am trying to install the Norwegian language pack for Suitecrm 7.2.1. I experience a problem when attempting to change the locale to Norwegian after the installation.

  • I install without any issues through module loader.

  • I do a quick repair

  • If I log out at this stage the Norwegian language option shows up, but if i choosed that one and try to enter the admin panel, I get a blank page.

  • If I try to change the locale in the admin panel and leave the admin panel I get a blank page when trying to enter the admin panel again.

All other menu options function.

Is it possible to create a step by step fix tutorial?
if not, I hope this can be solved some other way.

Best regards
Raymond

Hi Raymond,

please try to delete everything in your :

SugarInstallDir/cache/upgrades
SugarInstallDir/uploads/upgrades/patches

SugarInstallDir\cache\upload\upgrade

1 Like

Hi Raymond,

Your issue probably can not be fixed by the solution described in this thread.

Is your screen completely blank when you enter admin or do you still have the SuiteCRM header menu visible?

In the first case, after reproducing the bug, check the apache/nginx error log. Depending on your OS/distribution you can find it here:


/var/log/httpd_error.log
/var/log/apache2/error.log

Tell us what you see in the last lines of the log file.

1 Like

Hi Jan:
Here is text from the error.log file.
I see that there are some permission issues, but for the suitecrm2 folder i set 777 while testing?
Also: The screen goes completely blank when trying to access the administrator panel. as i said before, all other menu items seem to function normally.

[Wed May 27 06:26:32.336012 2015] [mpm_prefork:notice] [pid 21680] AH00163: Apache/2.4.10 (Ubuntu) configured – resuming normal operations
[Wed May 27 06:26:32.336061 2015] [core:notice] [pid 21680] AH00094: Command line: ‘/usr/sbin/apache2’
[Wed May 27 08:57:52.376022 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.html denie$
[Wed May 27 08:57:52.376121 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.cgi denied$
[Wed May 27 08:57:52.376158 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.pl denied $
[Wed May 27 08:57:52.376193 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.php denied$
[Wed May 27 08:57:52.376227 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.xhtml deni$
[Wed May 27 08:57:52.376260 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.htm denied$
[Wed May 27 08:58:58.265267 2015] [:error] [pid 29911] [client 192.168.68.110:55186] PHP Notice: Undefined variable: js_custom_version in /var/www/html/suitecrm/suite$
[Wed May 27 08:59:17.216631 2015] [:error] [pid 31002] [client 192.168.68.110:55193] PHP Notice: Undefined index: db_port in /var/www/html/suitecrm/suitecrm2/include/$
[Wed May 27 08:59:17.219608 2015] [:error] [pid 31002] [client 192.168.68.110:55193] PHP Notice: Undefined index: db_port in /var/www/html/suitecrm/suitecrm2/include/$
[Wed May 27 09:00:08.750796 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:08.751471 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:08.809879 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:08.809947 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:08.810395 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:08.910084 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:08.910151 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:08.910633 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.010255 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.010329 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:09.010813 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.060393 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.060459 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:09.060895 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.110650 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.110715 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:09.111155 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.160777 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.160842 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:09.161278 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.211026 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.211092 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:09.211552 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:10.726073 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:10.726148 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:10.726645 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:10.776247 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
$ules/A$[Wed May 27 06:26:32.336012 2015] [mpm_prefork:notice] [pid 21680] AH00163: Apache/2.4.10 (Ubuntu) configured – resuming normal operations

Hey! :slight_smile: I solved the issue (temporarily atleast):

I turned on error reporting in index.php and found the line of code in the language file that was causing trouble, then i compared it to the original code in the english language file:

Turns out that all the url links in the norwegian language file was described this way: <a href="\
In the english file the links where described with <a href=’
so i changed all the links, and it works :slight_smile:

Thanks for the feedback.
Hope what i did was right? :wink:

I have exactly same problem in Portuguese Language. Suite version 7.2.2. It works on English but on Portuguese Detailed view is blank

Do you have the solution for this issue? I’m using PHP 5.4

Regards

Luís

Actually I’ve solved it using Nick correction!

Thank you a lot Nick.!!