Use of undefined constant key - assumed 'key' error

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

Use of undefined constant key - assumed 'key' error

Postby 476 » Mon Jul 26, 2010 10:36 pm

Hello, Xataface seems really great, except that the Find feature isn't working for me. When I type in what I'm looking for and press Find I get these errors:

Notice: Use of undefined constant key - assumed 'key' in /xataface/Dataface/SearchForm.php on line 347
Notice: Use of undefined constant key - assumed 'key' in /xataface/Dataface/SearchForm.php on line 347
Notice: Use of undefined constant key - assumed 'key' in /xataface/Dataface/SearchForm.php on line 347
Notice: Use of undefined constant key - assumed 'key' in /xataface/Dataface/SearchForm.php on line 347
Notice: Use of undefined constant key - assumed 'key' in /xataface/Dataface/SearchForm.php on line 347
Notice: Use of undefined constant key - assumed 'key' in /xataface/Dataface/SearchForm.php on line 347

This is what line 347 of SearchForm.php looks like:
} else if ( $key{0} == '-' and $key{1} != '-' and $key != '-action' and key != '-search' and strpos($key, '-find') !== 0 ){

Fatal error: Call to undefined method PEAR_Error::getField() in /xataface/Dataface/Table.php on line 2630

This is what line 2630 of Table.php looks like:
$this->_relatedFields[$path[0]][$path[1]] =& $relationship->getField($path[1]); //Dataface_Table::getTableField($absolute_name);

Also, when I go to the Find tab I have to scroll down the screen quite a ways before I see the search criteria boxes.

Thanks for any help!
476
 
Posts: 1
Joined: Mon Jul 26, 2010 10:22 pm

Re: Use of undefined constant key - assumed 'key' error

Postby jhenry » Wed Jul 28, 2010 10:12 am

Do you have a primary key set for the table that you are accessing? What data is in the table you are doing the find on? The primary key has to be set for xataface to work properly.

Jason
Do not mistake understanding for realization, and do not mistake realization for liberation....Tibetan Saying.
jhenry
 
Posts: 58
Joined: Sun Jul 12, 2009 1:20 pm
Location: Florida

Re: Use of undefined constant key - assumed 'key' error

Postby shannah » Wed Jul 28, 2010 10:15 am

I have fixed the typo in SearchForm.php line 347. You can download the latest from SVN http://weblite.ca/svn/dataface/core/tru ... chForm.php

The fatal error is another issue. It is likely related to one of your relationship definitions referencing a field that doesn't exist (capitals count).

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

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