Uncaught Unknown file table name: files

Uncaught Unknown file table name: files

MaikelMaikel Posts: 75Questions: 18Answers: 1

i have a custom button

{
extend: "selectedSingle",
text: "Start/Stop",
action: function ( e, dt, node, config ) {
var d = table.row( { selected: true } ).data();
console.log(d);
console.log(table);
console.log(editor);
editor.edit( table.row( { selected: true } ).index(), false )
.set( "mailing.status", ( editor.get("mailing.status") === "delayed" ? "started" : "delayed" ) )
.submit();
}
},

when this button is pressed i get the following error:
Uncaught Unknown file table name: files

debug from the datatables debugger
https://debug.datatables.net/odoqaf

any help would be apriciated, all other stuff in the table works perfectly, this used to work also

Answers

  • MaikelMaikel Posts: 75Questions: 18Answers: 1

    this is a debug with an upgraded version:
    https://debug.datatables.net/osasok

  • MaikelMaikel Posts: 75Questions: 18Answers: 1

    i traced it to the editor.file part

    , {
    - label: "Atachment:",
    - name: "mailing.attachment",
    - type: "upload",
    - display: function ( file_id ) {
    - return editor.file( 'files', file_id ).web_path;
    - }

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin

    Hi Maikel,

    Thanks for the debug trace. It shows "files": [], in the loaded data, so there would indeed be an error given.

    How are you populating the files information at the server-side?

    Allan

  • MaikelMaikel Posts: 75Questions: 18Answers: 1

    this is the serverside code

            DataTables\Editor::inst( $db, 'mailing' )
                ->fields(
                        DataTables\Editor\Field::inst( 'mailing.subject' )->validator( 'Validate::notEmpty' ),
                        DataTables\Editor\Field::inst( 'mailing.to' )->validator( 'Validate::notEmpty' ),
                        DataTables\Editor\Field::inst( 'mailing.creator' )->validator( 'Validate::notEmpty' ),
                        DataTables\Editor\Field::inst( 'mailing.status' )->validator( 'Validate::notEmpty' ),
                        DataTables\Editor\Field::inst( 'mailing.added' ),
                        DataTables\Editor\Field::inst( 'mailing.started' ),
                        DataTables\Editor\Field::inst( 'mailing.stopped' ),
                        DataTables\Editor\Field::inst( 'mailing.txt' ),
                        DataTables\Editor\Field::inst( 'mailing.id' ),
                        DataTables\Editor\Field::inst( 'mailing.addAccreditatie' ),
                        DataTables\Editor\Field::inst( 'mailing.addExcel' ),
                        DataTables\Editor\Field::inst( 'mailing.addContract' ),
                        DataTables\Editor\Field::inst( 'mailing.toType' ),
                        DataTables\Editor\Field::inst( 'mailing.toID' ),
                        DataTables\Editor\Field::inst( 'mailing.toStatus' ),
                        DataTables\Editor\Field::inst( 'files.filename' ),
                        DataTables\Editor\Field::inst( 'files.filesize' ),
                        DataTables\Editor\Field::inst( 'mailing.attachment' )
                            ->upload( DataTables\Editor\Upload::inst( $cfg->get('uploadDir').'/downloads/__ID__.__EXTN__' )
                                ->db( 'files', 'id', array(
                                    'filename'    => DataTables\Editor\Upload::DB_FILE_NAME,
                                    'filesize'    => DataTables\Editor\Upload::DB_FILE_SIZE,
                                    'web_path'    => DataTables\Editor\Upload::DB_WEB_PATH,
                                    'system_path' => DataTables\Editor\Upload::DB_SYSTEM_PATH
                                ) )
                              )
                )
                ->join(
                        DataTables\Editor\Mjoin::inst('mailing_que')
                                ->set(false)
                                ->link( 'mailing_que.mailing_id', 'mailing.id')
                                ->fields(
                                        DataTables\Editor\Field::inst( 'id' ),
                                        DataTables\Editor\Field::inst( 'status' )
                                )
                )
                ->leftJoin( 'files', 'mailing.attachment', '=', 'files.id' )
                ->debug( true )
                ->process( $p )
                ->json();
    
  • MaikelMaikel Posts: 75Questions: 18Answers: 1

    any idea whats going on here?
    we still see this problem.
    note that not all rows in the mailing table will have a file attached

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin

    Hi Maikel,

    Could you upload a new debug trace for me please? Old ones get deleted automatically.

    Thanks,
    Allan

Sign In or Register to comment.