[FX.php List] FX.php and Filemaker Layout mode error

Dale Bengston dale.bengston at gmail.com
Sat Apr 19 07:31:24 MDT 2014


Great project to integrate FileMaker with Drupal via FX.php! Not sure if this guy got an answer to what’s happening, so I’ll throw it out there. It’s pretty common. In fact, I think it should be covered in the FX.php docs. I think this probably happened to all of us when we first started out.

When FX.php returns results, the data (we’ll call it $results) is a PHP array, but when FX.php returns an error, $results is a PHP object. If your code uses a foreach to tick through $results, it will fail with the error message you received if $results is an error object.

Try a print_r($results) to dump the error object to the page so you can see what the error is. 

To handle this scenario gracefully, try wrapping your code in a check on what $results is:

if is_object($results)
	{
	//User-friendly error response
	}
else
	{
	//Display results
	}

Hope this helps, 
Dale

On Apr 17, 2014, at 1:30 AM, Cyrus Bondo <C.Bondo at cgiar.org> wrote:

>  
>  
> From: Sila, Andrew M. (ICRAF) 
> Sent: Thursday, April 17, 2014 9:19 AM
> To: Cyrus Bondo
> Subject: Re: FX.php and Filemaker Layout mode error
>  
> Excellent!
>  
> From: Cyrus Bondo <C.Bondo at cgiar.org>
> Date: Thu, 17 Apr 2014 09:16:34 +0300
> To: "junk4chris at iviking.org" <junk4chris at iviking.org>
> Cc: "Sila, Andrew M. (ICRAF)" <A.SILA at CGIAR.ORG>
> Subject: FX.php and Filemaker Layout mode error
>  
> Dear Chris,
> I am new in Drupal want to integrate Drupal with file maker database through the Drupal file maker module ,file maker form modules. Actually I have moved some steps doing some installations like the modules. But on the way, upon installing FX.php and then navigating to the Layout mode,Iget  Fatal error: Cannot use object of type FX_Error as array in C:\wamp\www\helpdesk\drupal-7.26\sites\all\modules\filemaker\classes\fmWebLayout.php on line778.Thanks.
> Please Help.
> Cyrus
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20140419/c1d2e789/attachment-0001.html


More information about the FX.php_List mailing list