 |
vtiger The Honest Open Source CRM
|
| Previous topic :: Next topic |
| Author |
Message |
pdavie
Joined: 03 May 2005
Posts: 31
|
| Posted: Sun Sep 24, 2006 10:32 pm Post subject: Weird Popup Error - Very urgent |
|
|
In the Quotes module, when I select "Account" and chose an entry from the Account Popup, it works sometimes, other times not, depending which record I select!
The records are all displayed OK and there are no funny characters in the data.
I get the infamous Object Not Found error: <url>/a.
I've looked at the code and as far as I can tell nothing seems to be wrong, the data is in the database and the log file says nothing.
Urgent help needed- this stopping a client from using the system!!!
Thanks in advance,
Peter |
|
| Back to top |
|
pdavie
Joined: 03 May 2005
Posts: 31
|
| Posted: Mon Sep 25, 2006 1:55 am Post subject: Re: Weird Popup Error - Very urgent |
|
|
PROBLEM SOLVED.
The issue was that some data was imported from Outlook which in some records had embedded Carriage Returns. During normal usage (editing records, printing, etc.) this does not affect vTiger.
However, because of the way the Popup html return value works (it includes the address in the return value), the HTML parser gets confused byt the line breaks in the code. Therefore the return URL is invalid and you get an "Object Not Found" error message.
Work around: Clean up the input data.
Longer Term: the import routine should really strip the CR/LF chars to avoid this kind of intended problem. |
|
| Back to top |
|
Sai
Joined: 22 Aug 2004
Posts: 1575
Location: Chennai, India
|
| Posted: Mon Sep 25, 2006 9:33 am Post subject: Re: Weird Popup Error - Very urgent |
|
|
Hello,
Thanks for posting your workaround.
In the next minor update we provide a permanent solution for handling CR/LF characters.
I have created Wiki article based on your inputs. Please have a look at How Tos in Wiki:
http://wiki.vtiger.com/index.php/Vtiger_CRM_-_How_To%27s#Error_Messages
Regards,
Gopal |
|
| Back to top |
|
pdavie
Joined: 03 May 2005
Posts: 31
|
| Posted: Mon Nov 27, 2006 2:18 pm Post subject: Re: Weird Popup Error - Very urgent |
|
|
Sai wrote: Hello,
Thanks for posting your workaround.
In the next minor update we provide a permanent solution for handling CR/LF characters.
I have created Wiki article based on your inputs. Please have a look at How Tos in Wiki:
http://wiki.vtiger.com/index.php/Vtiger_CRM_-_How_To%27s#Error_Messages
Regards,
Gopal
Thanks Gopal,
Since I put this post up, I added some code to the Product and Accounts popup that strips the CR/LF from the addresses, so that when the HTML list is populated, there are no embedded CR/LF.
I'm attaching the CR/LF stripping code and a snippet from ProductPopup.php as an example:
This code was inserted into utils.php near the bottom of the file.
Code: function stripNewLines($text)
{
return preg_replace("/\r\n|\n|\r/", " ", $text);
}
Code Snippet (from approx. line 3942 in utils.php, your mileage may vary)
Code: $value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_address("'.$entity_id.'", "'.$temp_val.'", "'.stripNewLines($acct_focus->column_fields['bill_street']).'", "'.stripNewLines($acct_focus->column_fields['ship_street']).'", "'.stripNewLines($acct_focus->column_fields['bill_city']).'", "'.stripNewLines($acct_focus->column_fields['ship_city']).'", "'.$acct_focus->column_fields['bill_state'].'", "'.$acct_focus->column_fields['ship_state'].'", "'.$acct_focus->column_fields['bill_code'].'", "'.$acct_focus->column_fields['ship_code'].'", "'.$acct_focus->column_fields['bill_country'].'", "'.$acct_focus->column_fields['ship_country'].'"); window.close()\'>'.$temp_val.'</a>';
Hope this is of some use.
Peter |
|
| Back to top |
|
pdavie
Joined: 03 May 2005
Posts: 31
|
| Posted: Mon Nov 27, 2006 2:20 pm Post subject: Re: Weird Popup Error - Very urgent |
|
|
| Sorry! The file is not ProductPopup.php but utils.php -- Clearly the two names are so similar I confused them ;-) |
|
| Back to top |
|
| |
|