Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

FATAL ERROR: i18n::include_by_class: Class TableListField.ss.Form not found


Reply


792 Views

Avatar
eoor

Community Member, 5 Posts

10 September 2008 at 9:29am

Hi, i get this error FATAL ERROR: i18n::include_by_class: Class TableListField.ss.Form not found when I try to add TableListField component into administration panel.I'm using this example of TableListField

function getReportField() {      
   $resultSet = new DataObjectSet();
   $filter = '';
   $sort = "Member.ID ASC";
   $join = '';
   $instance = singleton('Member');      
   $query = $instance->buildSQL($filter, $sort, null, $join);
   $query->groupby[] = 'Member.ID';
   
   $report = new TableListField(
      'CorporateReport',
      'Member',
      array(
         'ID' => 'ID',
         'FirstName' => 'First Name',
         'Surname' => 'Surname',
         'Email' => 'Email',
         'MembershipType' => 'Membership Type',
         'MembershipStatus' => 'Membership Status',
         'DateJoined' => 'Date Joined',
         'PaidUntil' => 'Paid Until',
         'Edit' => ''
      )
   );
      
   $report->setCustomQuery($query);
      
   $report->setFieldFormatting(array(
      'Email' => '<a href=\"mailto: $Email\" title=\"Email $FirstName\">$Email</a>',
      'Edit' => '<a href=\"admin/security/index/1?executeForm=EditForm&ID=1&ajax=1&action_callfieldmethod&fieldName=Members&ctf[childID]=$ID&ctf[ID]=1&ctf[start]=0&methodName=edit\"><img src=\"cms/images/edit.gif\" alt=\"Edit this member\" /></a>'
   ));
      
   $report->setFieldCasting(array(
      'DateJoined' => 'Date->Nice',
      'PaidUntil' => 'Date->Nice'
   ));
      
   $report->setShowPagination(true);
   if(isset($_REQUEST['printable'])) {
      $report->setPageSize(false);
   } else {
      $report->setPageSize(20);
   }
      
   $report->setPermissions(array(
      'export',
      'delete',
      'print'
   ));
      
   return $report;
}

and I want to add this table into EditForm() function in CommentAdmin, replacing $table with returned TableLIstField object from getReportField function:

$table = new CommentTableField($this, "Comments", "PageComment", $section, $tableFields, $popupFields, array($filter));
      $table->setParentClass(false);
      
      $fields = new FieldSet(
         new TabSet(   'Root',
            new Tab(_t('CommentAdmin.COMMENTS', 'Comments'),
               new LiteralField("Title", $title),
               $idField,
               $table // replaced by return of getReportField()
            )
         )
      );

In Developer mode i get error in subject, but for one, two seconds I can view correct table with correct data. What's wrong?