0

I am using sugarcrm version 5.5.4. I have installed language pack for Persian language. When I am trying to set a call from Accounts subpanel i.e from Activities tab, when the language is English, the reminder popup works fine. But when I change the language to Persian, reminder popup does not appears. After lot of research I found that, the query executed to fetch the reminder calls is from "include/javascript/jsAlerts.php" When I set up a call from English language query executed is like -

SELECT name, calls.id, description, date_start, reminder_time FROM calls LEFT JOIN calls_users ON calls.id = calls_users.call_id WHERE calls_users.user_id=1 AND calls.reminder_time !=-1 AND calls_users.deleted !=1 and date_start>='2014-01-31 09:16:34' AND date_start<='2014-01-31 10:16:34'

and if I change the language to Persian then query executed is -

SELECT name, calls.id, description, date_start, reminder_time FROM calls LEFT JOIN calls_users ON calls.id = calls_users.call_id WHERE calls_users.user_id = 1 AND calls.reminder_time! = -1 AND calls_users.deleted! = 1 and date_start> = '2014-01-31 09:16:34 'AND date_start <= '2014-01-31 10:16:34'

If you observe, in second query there are syntax errors near calls.reminder_time! = -1 and date_start> = '2014-01-31 07:55:32 'AND .

Thats why query is not executed properly and popup not appears.
Original query from jsAlerts.php doesn't have any such errors, then why it executes in this way. I have tried using various string operations, but nothing helped.
Also, if after creating call from Persian language from same way, and I visit to other pages or simply refresh the same page, then query works fine. Issue is only when I create the call and wait on the same page for the reminder.
Is there any way to overcome from this problem? Any help is appreciated. Thanks.

SandyK
  • 465
  • 1
  • 9
  • 28

1 Answers1

0

SandyK there is always a way.

My first thought would be to look to upgrade the system. 5.5.4 is 3+ years out of date and it's pretty likely that this sort of bug has been fixed by now.

If you cannot upgrade or the upgrade doesn't fix this, I would look into include/javascript/jsAlerts.php directly (possibly jssource/include/javascript/jsAlerts.php as they are usually not minified and easier to read) and try to trace the problem there. You'll likely find a string of dependencies but ultimately you'll find where the query is built and should be able to fix the bug.

Matthew Poer
  • 1,682
  • 10
  • 17