Jump to content
Sign in to follow this  

Empty Related Data Returns Error with FX.php

Recommended Posts

After a day of debugging I've found my problem. But it shouldn't be a problem, and I'm wondering if others are facing the same issue.

I have a layout/table for Jobs (called WebOneJobOK). Each job has and Architect, stored as a number. The Architect number is used to relate to a table called Architect, which has the related info for the architect -- name, phone, etc. This is really straightforward relational DB theory, and works fine within FileMaker.

The problem comes when I access this data via FX.php. Suppose the layout has 3 fields: JobNumber, Architect, and Architect::Name. I perform a find based on the job number

$userOneJob = new FX($FMAddress, $FMPort);

$userOneJob -> setDBUserPass('WebUser' , $FMPassword);

$userOneJob -> setDBData('CabiNet.fp7' , 'WebOneJobOK');

$userOneJob -> AddDBParam('WSJobNumber' , $jobNumber, 'eq'); // Job number has been converted to a php field, $jobNumber.

$userOneJobResult = $userOneJob -> FMFind();

echo "<pre>nn";

print_r ($userOneJobResult);

echo "</pre>nn";

If the job has an Architect specified, everything works fine. But if the field is empty, I get an error message:

FX_Error Object


[error_message_prefix] =>

[mode] => 1

[level] => 1024

 => 100

[message] => FX: ExecuteQuery XML error: XML_ERR_DOCUMENT_END at line 2

[userinfo] =>

[backtrace] => Array


[0] => Array


[file] => c:inetpubwwwrootCabiNetFXFX.php

[line] => 889

[function] => FX_Error

[class] => FX_Error

[type] => ->

[args] => Array


[0] => ExecuteQuery XML error: XML_ERR_DOCUMENT_END at line 2



So it is a problem with the xml result, but not one I can readily decipher.

However, if I take Architect::Name off the layout, everything works fine, even if Archietct is empty. I just get the correct array with that data empty. The workaround I have is to create a calc field within Jobs -- ArchitectName = Architect::Name. I can put this on the layout and it works OK, empty or not. But I thought I had left this kind of trickery behind with FM6.

Anyone have any ideas on why empty related data is causing the error? I guess I can live with the workaround, but I'd rather not have to.



PS - one more thing I just tried. If I put Architect::Name in a 1-line portal rather than just directly on the layout, it works fine, empty or not. Weird. I guess I'd rather do this than create many calc fields as a work around.

Any thoughts?

Share this post

Link to post
Share on other sites

One more thing. This must be a problem with FM, not FX.php, because if I bypass FX and just shoot the raw url to FM, I get the same kind of error.

Share this post

Link to post
Share on other sites

Thanks, Garry. I'm glad to know when I'm not just talking to myself. I've submitted it to FM, referencing this thread in my bug report. We'll see what happens.



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

By using this site, you agree to our Terms of Use.