Create is undefined

Create is undefined

mRendermRender Posts: 151Questions: 26Answers: 13

Not sure why I'm getting this error: Uncaught TypeError: Cannot read property 'create' of undefined

Debug: http://debug.datatables.net/ifanop

URL: http://207.7.84.72/allevents.php

This page was working until I updated Datatables from 1.10.6 to 1.10.7 and put in some upload code for a field. All of the upload code looks good to me though.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin
    Answer ✓

    type: "upload",

    But the upload plug-in doesn't appear to have been included on the page.

    Allan

  • mRendermRender Posts: 151Questions: 26Answers: 13

    That would be an issue. Thanks.

    I'm getting a SQL syntax error about the file upload.

    Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM logofiles WHERE logofiles.ELID = '5'' at line 1

    It seems that the file uploader is adding '.' instead of logofiles.ELID

    Here is the code for server upload page:

    Field::inst( 'events.eventlogo' )
            ->upload(
            Upload::inst( $_SERVER['DOCUMENT_ROOT'].'/uploads/__NAME__' )
                ->db( 'logofiles', 'logofiles.ELID', array(
                    'logofiles.fileName' => Upload::DB_FILE_NAME,
                    'logofiles.fileSize' => Upload::DB_FILE_SIZE,
                    'logofiles.webPath' => Upload::DB_WEB_PATH,
                    'logofiles.path' => Upload::DB_SYSTEM_PATH
                ) ) ),
    
  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin

    ->db( 'logofiles', 'logofiles.ELID'

    Just use:

    ->db( 'logofiles', 'ELID'
    

    Allan

  • mRendermRender Posts: 151Questions: 26Answers: 13

    Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM logofiles WHERE ELID = '6'' at line 1

  • mRendermRender Posts: 151Questions: 26Answers: 13

    Got it - needed to also include Field::inst() of logofiles. Thanks!

This discussion has been closed.