Fatal error: Call to private method DataTables\Editor::_ssp_field() from context ''

Fatal error: Call to private method DataTables\Editor::_ssp_field() from context ''

mpcleverdonmpcleverdon Posts: 19Questions: 2Answers: 0

Hi

I am getting this error on the production server but not on my development laptop

Fatal error: Call to private method DataTables\Editor::_ssp_field() from context '' in /var/www/vhosts
/bookt.lanzarote1.com/httpdocs/inc/dt/php/lib/Editor/Editor.php on line 1444

Here is the debug for the development wamp platform which works fine - 3 tables each filtered / searched from select fields in form.

http://debug.datatables.net/amufuc

The server envronment is LAMP

Regards Mark

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Is a PHP version "problem". Its actually an accessibility issue in the Editor class with old versions of PHP, so it sounds like your production server is using an old 5.3 version of PHP while your dev server is something newer.

    To fix, open the Editor.php file and find the function _ssp_field. Change it from private to public. That change will be in the next release of Editor for backwards compatibility with old versions of PHP :smile:.

    Allan

  • mpcleverdonmpcleverdon Posts: 19Questions: 2Answers: 0

    Thank you very much for your prompt reply and this excelent project Alan

    Regards Mark

  • sebdesignlondonsebdesignlondon Posts: 4Questions: 1Answers: 0

    Hi, I have the same issue.
    When i change the function to public I then get this error:

    DataTables warning: table id=example - Unknown field: (index 0)

    Anybody knows why ?

    Thanks

    Seb

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin

    Happy to take a look if you post a link to test case. It suggests that DataTables is trying to read data that isn't there. possibly a mismatch in the number of columns between the HTML and Javascript, but I'd need to be able to see the page to say for sure.

    Allan

  • sebdesignlondonsebdesignlondon Posts: 4Questions: 1Answers: 0

    Hi,

    I have solved the issue by removing the first column that included a tickbox.
    If i add the column again the table fires a mismatch error.

    How can I add a column with the tick box that doesn't confuse the AJAX / server ?

    Thanks

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin

    If you post a link to the page I'd be happy to take a look. As this example shows, it should be quite possible to have a checkbox field for many options.

    Allan

  • sebdesignlondonsebdesignlondon Posts: 4Questions: 1Answers: 0

    Ok,

    Can you send me a private contact detail so I can send you the link ?
    On a different note, how do you prevent the .php file from being accessible directly from the browser url ?

    chmod ?

    Thanks

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin

    Click me name above and then click the "Send message" button, which will show a form to send me a PM.

    On a different note, how do you prevent the .php file from being accessible directly from the browser url ?

    You can't. It has to be, otherwise it wouldn't be able to be loaded! The source code should never be seen, in exactly the same way as you can enter the URL for an image directly into a browser's URL bar, you can also enter a php file.

    Allan

This discussion has been closed.