preg_grep() error when clicking relationships

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

preg_grep() error when clicking relationships

Postby Bart » Sun Jan 31, 2010 3:14 pm

Hi,

I've followed the manual to set up relationships and they appear fine when I select a record, but when I click "see all" or the newly created tab with the name of the relationship, I get these warnings & errors:
Found 1 Records in relationship Klant
Now Showing 1 to 1
(Display Records per page)

* RSS RSS
* Export XML Export XML
* Export CSV Export CSV


Warning: preg_grep() [function.preg-grep]: Unknown modifier 'r' in /home/user/public_html/xataface/Dataface/Relationship.php on line 874

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/user/public_html/xataface/Dataface/Relationship.php on line 877

Notice: On line 422 of file /home/user/public_html/xataface/Dataface/Table.php in function printStackTrace(Invalid tablename specified.,256)
On line 2348 of file /home/user/public_html/xataface/Dataface/Table.php in function Dataface_Table(,Resource id #10,)
On line 880 of file /home/user/public_html/xataface/Dataface/Relationship.php in function loadTable()
On line 2629 of file /home/user/public_html/xataface/Dataface/Table.php in function getField(Land/regio)
On line 391 of file /home/user/public_html/xataface/Dataface/RelatedList.php in function getField(Klant.Land/regio)
On line 860 of file /home/user/public_html/xataface/Dataface/SkinTool.php in function toHtml()
On line 12 of file /home/user/public_html/xataface/Dataface/templates_c/dataface/%%4F^4F5^4F541920%%Dataface_Related_Records_List.html.php in function related_list(array(),Dataface_SkinTool Object)
On line 1258 of file /home/user/public_html/xataface/lib/Smarty/Smarty.class.php in function include(/home/user in /home/user/public_html/xataface/Dataface/Table.php on line 422

Fatal error: Error performing mysql query to get column information from table ''. The mysql error returned was : 'Incorrect table name '''.
On line 477 of file /home/user/public_html/xataface/Dataface/Table.php in function printStackTrace()
On line 2348 of file /home/user/public_html/xataface/Dataface/Table.php in function Dataface_Table(,Resource id #10,)
On line 880 of file /home/user/public_html/xataface/Dataface/Relationship.php in function loadTable()
On line 2629 of file /home/user/public_html/xataface/Dataface/Table.php in function getField(Land/regio)
On line 391 of file /home/user/public_html/xataface/Dataface/RelatedList.php in function getField(Klant.Land/regio)
On line 860 of file /home/user/public_html/xataface/Dataface/SkinTool.php in function toHtml()
On line 12 of file /home/user/public_html/xataface/Dataface/templates_c/dataface/%%4F^4F5^4F541920%%Dataface_Related_Records_List.html.php in function related_list(array(),Dataface_SkinTool Object)
On line 1258 o in /home/user/public_html/xataface/Dataface/Table.php on line 477


Interventies.Klant refers to Klanten.Id, so in tables/Interventies I created a relationships.ini:
[Klant]
Klanten.Id = "$Klant"


I'm sure the relationship works, because when I click RSS, it show the correct record for "Klant".

Thanks for any help!

Kind regards,
Bart
Bart
 
Posts: 3
Joined: Sun Jan 31, 2010 3:04 pm

Re: preg_grep() error when clicking relationships

Postby shannah » Thu Feb 04, 2010 11:53 am

This is a bug. I have fixed it in SVN. You can fix it by changing line 874 of Dataface/Relationship.php from
Code: Select all
$fields = preg_grep('/\.'.$fieldname.'$/', $this->fields(true));

to
Code: Select all
$fields = preg_grep('/\.'.preg_quote($fieldname,'/').'$/', $this->fields(true));
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: preg_grep() error when clicking relationships

Postby Bart » Thu Feb 04, 2010 12:07 pm

Thank you!

I've made the modification and now it all works.

Kind regards,
Bart
Bart
 
Posts: 3
Joined: Sun Jan 31, 2010 3:04 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 19 guests

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