November 4, 200421 yr 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 ) etc.... 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. Thanks, Dan 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?
November 4, 200421 yr Author 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.
November 4, 200421 yr Author One More One More thing... Empty related data seems to work fine on other layouts...
November 4, 200421 yr It sounds similar to a problem we had a few years ago with CDML. Unfortunately, I can't remember the details of it : Good Luck. Garry
November 5, 200421 yr Author 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. Best, Dan
Create an account or sign in to comment