[Vtigercrm-developers] au tiny bug with search words on potential module

Baroiller Pierre-Emmanuel baroiller at daoditu.com
Wed Nov 21 05:41:46 PST 2007


hi all,

some users reported me an error on potential module where they can't 
click any "button".
after investigation, i've found where was the bug and i think it may be 
usefull for other people.

in Smarty/templates/RelatedListContents.tpl

we have :
{if $BASE_ACCOUNT neq ''}
        {assign var="search_string" 
value="&search_field=accountid&query=true&searchtype=BasicSearch&search_text=$BASE_ACCOUNT&check_rel=potential_rel"}
{/if}

where $BASE_ACCOUNT is an account name but.. what it this account have 
some ' in it ??
the result is a javascript error that lock all other js on the loaded page.

to fix this little error, change these files :

modules/Potentials/DetailView.php
change
$smarty->assign("BASE_ACCOUNT",getAccountName($focus->column_fields[account_id]));
with
$smarty->assign("BASE_ACCOUNT",rawurlencode(getAccountName($focus->column_fields[account_id])));

and

modules/Potential/CallRelatedList.php
change
    
$smarty->assign("BASE_ACCOUNT",getAccountName($focus->column_fields[account_id]));
with
    
$smarty->assign("BASE_ACCOUNT",rawurlencode(getAccountName($focus->column_fields[account_id])));


regards

-- 

Pierre-Emmanuel Baroiller




More information about the vtigercrm-developers mailing list