Fatal Error: Call to a member function hasJoinTable() ...

A place for users and developers of the Xataface to discuss and receive support.

Fatal Error: Call to a member function hasJoinTable() ...

Postby andperry » Thu Jul 26, 2012 3:07 am

Regarding following error message:-

Code: Select all
Fatal error: Call to a member function hasJoinTable() on a non-object in D:\Users\Common\Documents\WebSite\All_Sites\public_html\xataface-1.3.2\Dataface\FormTool.php on line 930


(This example shows a Windows pathname, but the problems seem to be same on a Linux platform.)

I've had a couple of issues in the past where a similar message has been generated and on raising them in the forum, the response seems to have been that this is an obscure condition that should not normally occur. It has happened a couple of times recently and I have a little more information that may shed some light on the situation.

On one occasion it turned out that there was a newline character at the end of one of the record fields. I don't have the information now to reproduce the situation, but it was cured by removing the offending character - had to do it via phpMyAdmin as Xataface generated the error when trying to edit the record!

Here is the latest scenario. I have a view which was orginally created using the following SQL command:-

Code: Select all
CREATE VIEW desktop3_desktop4 AS SELECT * FROM app_instances WHERE computer_name='Desktop3' OR computer_name='Desktop4' ORDER BY app_title,computer_name;


On trying to edit a record in the view (configured as a table in Xataface) the fatal error occurred. If the view was re-created without everything from the WHERE clause onwards, there was no problem. Thinking back to the former problem with new line characters, I wondered whether there was anything strange about the format of the record field, so tried re-creating the view with the command:-

Code: Select all
CREATE VIEW desktop3_desktop4 AS SELECT * FROM app_instances WHERE computer_name LIKE 'Desktop3%' OR computer_name LIKE 'Desktop4%' ORDER BY app_title,computer_name;


On doing this the problem went away.

I'm up and running now as a result, but thought it would be helpful to share this information, in case there is an underlying problem that needs investigation.

Thanks,

Andrew.
andperry
 
Posts: 57
Joined: Wed Feb 18, 2009 9:20 am
Location: Wirral, UK

Re: Fatal Error: Call to a member function hasJoinTable() ..

Postby shannah » Thu Jul 26, 2012 11:18 am

This is likely caused because you inserted a record into the view that ultimately isn't part of the view - so Xataface barfed when it came time to show the view tab for the record just inserted... The record apparently doesn't exist - even though it was successfully added to the underlying table.

Changing your view definition loosened the filter and probably caused your inserted record to still be part of the view. But you could probably still get the error to occur by inserting a record that wouldn't be matched by the where clause.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved