Page 1 of 1

build search index

PostPosted: Wed Jun 23, 2010 7:05 pm
by omills
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

Re: build search index

PostPosted: Thu Jun 24, 2010 8:47 am
by shannah
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<br>"; 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);
         }


Re: build search index

PostPosted: Tue Jul 13, 2010 9:55 am
by omills
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');
   }