elDaz2 Posted January 6, 2006 Posted January 6, 2006 I've built a web solution using FX.PHP and FMSA 7 on a Windows server 2003 with APACHE 2. Everything was ready for the release but I was waiting FMSA 8 before going live. I received my copy of FMSA 8 on Monday and was pleased that my complete FX.PHP site worked well until I reached a specific record using a field on a related table that was empty ... From then, I received those errors on every pages that contain an empty field on a related table thus, no data display at all: (errors form APACHE 2 error log file) PHP Warning: Cannot use a scalar value as an array in [...] section4F.php [...] PHP Warning: Invalid argument supplied for foreach() [...] section4F.php [...] PHP Notice: Undefined variable: findData in [...] section4F.php [...] Is there a problem with FX.PHP (4.0) and FMSA 8 ?? I need to find out fast ! My release date is in 2 weeks ! HELP David St-Onge Maerix
JCB Posted January 6, 2006 Posted January 6, 2006 "Warning: Cannot use a scalar value as an array in" I have had this warning using FMSA 7 in my testing it happens if I have a related field on the layout I am referencing in php and it is blank (does not exist). If the related field exists and has a value, I do not get the warning. If I remove the related field from the layout, I do not get the error. This is not an acceptable solution. I have searched high and low for an answer. You may be experiencing a similar issue. Let me know if you are.
elDaz2 Posted January 6, 2006 Author Posted January 6, 2006 Hi JCB, I would like to know if the problem with FMSA 7 prevented your whole page to display or it was just an error or a warning in the log file ? On my side, in FMSA 7 it was just a display in the log and in FMSA 8 it prevent data on the page to display. David St-Onge Maerix
JCB Posted January 6, 2006 Posted January 6, 2006 The page would display, but that data from filemaker would not display until I removed the related field from the layout.
andygaunt Posted January 10, 2006 Posted January 10, 2006 We have found the same error during our testing. It seems that the problem is definitely with the way the XML is returned to FX.PHP with the advent of a related field on a layout (in a portal or not) without a related record. This causes the entire breakdown of the XML returned by FileMaker to FX.PHP for forming of its array. When doing print_r($r); we can view the following in the source code (substituted the square brackets for ( ) in the code FX_Error Object ( (error_message_prefix) => (mode) => 1 (level) => 1024 (code) => 100 (message) => FX: ExecuteQuery XML error: Invalid document end at line 2 (userinfo) => (backtrace) => Array ( (0) => Array ( (file) => path_hereFXFX.php (line) => 1262 (function) => FX_Error (class) => FX_Error (type) => -> (args) => Array ( (0) => ExecuteQuery XML error: Invalid document end at line 2 ) ) (1) => Array ( (file) => path_here FXFX.php (line) => 1417 (function) => ExecuteQuery (class) => FX (type) => -> (args) => Array ( (0) => -find ) ) (2) => Array ( (file) path_here FXFX.php (line) => 1624 (function) => FMAction (class) => FX (type) => -> (args) => Array ( (0) => -find (1) => 1 (2) => full (3) => 1 ) ) (3) => Array ( (file) => path_here filename.php (line) => 32 (function) => FMFind (class) => FX (type) => -> (args) => Array ( ) ) ) (callback) => ) If we do a manual call to FileMaker using the normally returned URL that is found in the FX.PHP array to view the XML tree http://$serverIP/fmi/xml/fmresultset.xml?-db=$webDB&-lay=$layout&Field=x&-find then we receive the following; The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. -------------------------------------------------------------------------------- The following tags were not closed: FMPXMLRESULT, RESULTSET, ROW. Error processing resource 'http://filemaker7hosting.com/f... It seems the error is with the FMPXMLRESULT grammar. Lets see if this causes any stirrings in the brains!
andygaunt Posted January 10, 2006 Posted January 10, 2006 With regards to the related fields in FMS7A as long as the fields are in a portal, you will not get the error. This however is not the case anymore for FMS8A. As soon as one record does not have a related record then the resulting array for your Query is not returned. After testing the FX_Error angle and removing the require_once of this as well as the return new call within FX.PHP the data is returned to the array UPTO the point that the first record with no related record is reached. At this point the array is broken.
JCB Posted January 12, 2006 Posted January 12, 2006 So you are saying that this is a bug? If so who do we report this to? What do we do if we need to display related field on a layout and sometimes they are blank.
Wim Decorte Posted January 13, 2006 Posted January 13, 2006 FMI is aware of this bug and working on a solution. Here is where you report bugs: http://www.filemaker.com/company/product/problems.html
elDaz2 Posted January 13, 2006 Author Posted January 13, 2006 andygaunt That's kind of strange because I did put every related field on a portal and it did work. My solution works completely since then. I do not experience this bug ... Good for me ! But kind of weird ?!
andygaunt Posted January 13, 2006 Posted January 13, 2006 Do you have any parent records that do not have related records? In our testing it worked fine as long as the child record existed for each of the parent records returned via the query.
elDaz2 Posted January 13, 2006 Author Posted January 13, 2006 Yes, some of those records have "blank" related fields. And before putting those fields in a portal, the data on the page would'nt display if a related field would be "blank". It really seems that I do not experience this bug.
andygaunt Posted January 20, 2006 Posted January 20, 2006 We are seeing random occurrences of this issue. Issue, no related records for parent record on an FX query. If the related field is just placed on the layout the FX errors out as above post with a scalar value error (both Mac and Win servers) If the related fields are placed inside portals then on all Mac OSX servers tested on the FX.PHP acts as FMS7A and skips over that negative array. On some windows boxes the XML is truncated and errors out. However this is not the case on all windows boxes. Again, please follow the advice of Wim in the above post and report the bug to FMI. They are aware of the issue, but always good to get as much information as possible. If you are not experiencing the bug, maybe submit a report stating your exact server setup. This could help narrow the search to locate the issue.
John May - Point In Space Posted January 21, 2006 Posted January 21, 2006 FYI, we have found this bug only exists on the Windows side of things, NOT on OS X. - John
EC Posted January 23, 2006 Posted January 23, 2006 Do you have each of your related fields inside a portal on your layout? If not, there will be problems, especially if there is a possibility of an empty related field.
John May - Point In Space Posted January 23, 2006 Posted January 23, 2006 Note that with FMSA7 on Windows only (not OS X), even if you do have your related fields in a portal, if you have any records with no corresponding related record, FMSA's XML will return no data. Note that even if you DO have related records for all records in the main database, with both FMSA7 and FMSA8, on both Windows and OS X, you need to have your related field in a portal for proper functionality. - John
andygaunt Posted January 25, 2006 Posted January 25, 2006 John - Didn't you mean FMSA8 for Windows does not return the XML data if any record has no related record? With FMSA7 the problem did not arise on either platform (as long as you used portals that is!)
John May - Point In Space Posted January 25, 2006 Posted January 25, 2006 Andy - Correct, with FMSA8 on Windows, if a record does not have a related record, no data will be returned. This bug does not exist with FMSA8 on OS X, however no matter what you need to have the related field in a portal for things to work at all - even if all records have related records. - John
JCB Posted February 4, 2006 Posted February 4, 2006 Looks like FileMaker has released an update to resolve this problem. http://www.filemaker.com/support/downloads/index.html Has anyone tested it?
John May - Point In Space Posted February 4, 2006 Posted February 4, 2006 Yeap, works great on OS X based on our experience. Rumor has it it fixes the problems on Windows too. - John
andygaunt Posted February 5, 2006 Posted February 5, 2006 Rumors are correct John. Everything is peachy on all platforms. In fact, as you well know, it is better than before. Now the XML will not truncate if a field from an unrelated table is non the layout AND you can place fields fdirectly on the layout from a related table occurrence. This is useful if you only have a single related record (saves making a portal!)
Recommended Posts
This topic is 6936 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now