searchform error with relationships

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

searchform error with relationships

Postby omills » Tue Jul 13, 2010 9:42 am

Hi,

Using v1.2.5, I have the following error doing a simple search in the find tab:

Code: Select all
Failed to get field Volunteer_Hours/ID: 2Failed to get field Volunteer_Hours/topic: 2Failed to get field Volunteer_Hours/numofhours: 2Failed to get field Volunteer_Hours/notes: 2
Warning: Cannot modify header information - headers already sent by (output started at /var/www/infobase/xataface/Dataface/SearchForm.php:332) in /var/www/infobase/xataface/Dataface/SearchForm.php on line 354


Thanks for some insight!

Here are my table constructs:

volunteers table
Code: Select all
CREATE TABLE IF NOT EXISTS `volunteers` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `peopleID` int(11) NOT NULL,
  `occupation` varchar(50) DEFAULT NULL,
  `intakedate` date NOT NULL,
  `achievedhrs` tinyint(4) DEFAULT NULL,
  `areasofinterest` varchar(50) DEFAULT NULL,
  `otherinterest` varchar(150) DEFAULT NULL,
  `languages` varchar(100) DEFAULT NULL,
  `availability` varchar(200) DEFAULT NULL,
  `howhearcawst` text,
  `whycawst` text,
  `notes` text,
  `active` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;


volunteer hours table
Code: Select all
CREATE TABLE IF NOT EXISTS `volunteerhours` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `volunteerID` int(11) NOT NULL,
  `deptsID` int(11) NOT NULL,
  `topic` varchar(50) DEFAULT NULL,
  `numofhours` int(11) NOT NULL,
  `notes` text,
  `month` enum('January','February','March','April','May','June','July','August','September','October','November','December') DEFAULT NULL,
  `year` int(4) NOT NULL DEFAULT '2010',
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;


And relationships.ini file for the volunteers table:

Code: Select all
[Volunteer Hours]
volunteerhours.volunteerID = "$ID"


I also have a __sql__ at the beginning of my fields.ini (for volunteers table)...

Code: Select all
__sql__  = "SELECT v.*, sum(h.numofhours) as thours FROM volunteers v LEFT JOIN volunteerhours h ON h.volunteerID=v.ID GROUP BY v.ID"
omills
 
Posts: 18
Joined: Sat Nov 07, 2009 11:01 am

Re: searchform error with relationships {SOLVED?BUG?]

Postby omills » Wed Aug 04, 2010 8:07 pm

So it appears that Xataface doesnt like the space character in the relationships.ini block definition...
Code: Select all
[Volunteer Hours]

should be replaced by
Code: Select all
[Volunteer_Hours]


An advice on this... I like the space, because it makes the tab more readable...

Thanks!
omills
 
Posts: 18
Joined: Sat Nov 07, 2009 11:01 am

Re: searchform error with relationships

Postby shannah » Wed Aug 11, 2010 10:07 am

Xataface doesn't like spaces in relationship names. Use the action:label directive to specify a label for your relationship. It has not such constraint.

http://xataface.com/wiki/relationships.ini_file

-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 30 guests

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