build search index

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

build search index

Postby 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
omills
 
Posts: 18
Joined: Sat Nov 07, 2009 11:01 am

Re: build search index

Postby 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<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);
         }

shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: build search index

Postby 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');
   }
omills
 
Posts: 18
Joined: Sat Nov 07, 2009 11:01 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 28 guests

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