Topic: [2.3.4] Exchange Rates Input Text Serious Bug

Hello,

I've found a bug in exchange rates menu section (under Banking and General Ledger). It is very serious bug because it could make your browser hang especially when you use Firefox.

Here are the steps to get this bug occurs
1. Select a currency that can make exchange rates form appear
2. Make sure that the exchange rates input text is empty
2. Put focus on exchange rates input text
3. Click the calendar icon above or click another html element
4. Bug appear

I think this is because the empty input text. I solve this bug by defining decimal number for exchange rate value. So, this input text will never empty.

Re: [2.3.4] Exchange Rates Input Text Serious Bug

Thank you for pointing this out. The bug was fixed in util.js , will be made available with next FA release.

Janusz

Re: [2.3.4] Exchange Rates Input Text Serious Bug

@Janusz
You're welcome brother. Happy to hear that it was fixed for next release. smile

4 (edited by captain_kuro 06/13/2011 09:51:03 am)

Re: [2.3.4] Exchange Rates Input Text Serious Bug

Actually it's not just because of empty field, I put "0," in exchange rates and then click another element. viola my browser hangs

Regards, [url=http://captainkuro.com]captain_kuro[/url]

Re: [2.3.4] Exchange Rates Input Text Serious Bug

OK, after few trial & error I found out that the problem lies in
file /js/utils.js :: function price_format(post, num, dec, label, color) // line 209
because every time variable "num" is 0 the browser hangs

What makes it worse is that 0 is the default value of "num"

if(isNaN(num))
        num = "0";

I don't know the exact code which lead this behaviour but I can be sure that it you put any input inside exchange rate which lead to value zero or NaN I guarantee your browser will hang.
When I try to put

if (num == 0) num = 1;

just below the code above, the behaviour vanish because value zero will never happens.

Perhaps the author of function price_format can inspect the javascript code to find the bug.

Regards, [url=http://captainkuro.com]captain_kuro[/url]

Re: [2.3.4] Exchange Rates Input Text Serious Bug

Yes, this bug was fixed in just relased FA 2.3.5.
Janusz