Use of undefined constant key - assumed ‘key’ error
Archived from the Xataface Users forum.
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!
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
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