Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » FATAL ERROR: i18n::include_by_class: Class TableListField.ss.Form not found

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

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

Page: 1
Go to End
Author Topic: 734 Views
  • eoor
    Avatar
    Community Member
    5 Posts

    FATAL ERROR: i18n::include_by_class: Class TableListField.ss.Form not found Link to this post

    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?

    734 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.