build search index

Archived from the Xataface Users forum.

omills — Wed Jun 23, 2010 7:05 pm

Using 1.2.5:

I get this message when I try to rebuild the search index:

Code: Select all
Fatal error: Call to undefined method PEAR_Error::getField() in /var/www/infobase/xataface/Dataface/Table.php  on line 2632

the url is

Code: Select all
index.php?-table=people&-action=manage_build_index&-cursor=0&-skip=0&-limit=30&-mode=list

shannah — Thu Jun 24, 2010 8:47 am

This error isn’t all that helpful. I’ve made a small change to Table.php that should propagate the error up another level to make some more sense:

Code: Select all

`Index: Dataface/Table.php

— Dataface/Table.php   (revision 1877)
+++ Dataface/Table.php   (revision 1878)
@@ -2627,7 +2627,10 @@
            //$absolute_name = Dataface_Table::absoluteFieldName($path[1], $relationship->_schema[‘selected_tables’], null, $relationship->_schema[‘columns’]);
            //echo “Absolute_name = $absolute_name\n
”; print_r($relationship->_schema[‘selected_tables’]);
            //echo Dataface_Error::printStackTrace();
-         
+            if ( PEAR::isError($relationship) ){
+               $err = PEAR::raiseError(SCHEMA_NO_SUCH_FIELD_ERROR,null,null,null, “Field $fieldname does not exist in table “.$this->tablename);
+               return $err;
+            }
            
            $this->_relatedFields[$path[0]][$path[1]] =& $relationship->getField($path[1]); //Dataface_Table::getTableField($absolute_name);
         }`


omills — Tue Jul 13, 2010 9:55 am

I am getting the following from the change made in Table.php:

Code: Select all
Fatal error: Cannot use object of type PEAR_Error as array in /var/www/infobase/xataface/Dataface/Table.php  on line 2991

line 2991 is the return line of this block:

Code: Select all
function isPassword($fieldname){       $field =& $this->getField($fieldname);       //if ( !is_array($field) ) return false;       return ($field['widget']['type'] == 'password');    }