[Vtigercrm-developers] v6 basic ajax

Uma S uma.s at vtiger.com
Tue Feb 11 05:48:22 GMT 2014


Hi Danny,

Raised a ticket in tracker (
http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7947),Please follow up.


On Mon, Feb 10, 2014 at 8:53 PM, Daniel Thompson
<developingdanny at gmail.com>wrote:

> Hi All,
>
> Ran into this within my dev enviroment
>
> foreach($records as $moduleName=>$recordModels) {
>  foreach($recordModels as $recordModel) {
>  $result[] = array('label'=>decode_html($recordModel->getName()),
> 'value'=>decode_html($recordModel->getName()), 'id'=>$recordModel->getId());
>  }
> }
>
> returns an error if no results are returned due to $records is not being
> checked before emit.
>
>
> Should be something like this.
>
> if(is_array($records))
> {
> foreach($records as $moduleName=>$recordModels) {
> foreach($recordModels as $recordModel) {
>  $result[] = array('label'=>decode_html($recordModel->getName()),
> 'value'=>decode_html($recordModel->getName()), 'id'=>$recordModel->getId());
>  }
> }
> }
>
> Regards,
>
> Danny
>
> _______________________________________________
> http://www.vtiger.com/
>



-- 
With
Best Regards
Uma.S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140211/f8439409/attachment-0001.html>


More information about the vtigercrm-developers mailing list