PHP 8.0 + Editor upgrading = no data

PHP 8.0 + Editor upgrading = no data

cha59cha59 Posts: 77Questions: 19Answers: 0
edited October 7 in DataTables 1.10

My Web-hotel has updated PHP to version 8.0. After a bit everything but data was OK, so I thought I had to renew my licens to newest version of editor. Having done so, I think I have a license problem. Renewed my license today and downloaded files with license inclusive, uploaded them to my server and linked to them. But I get the following messages:
Uncaught Error:
Editor requires DataTables 1.10.20 or newer
at datatables.min.js:115
at datatables.min.js:45
at datatables.min.js:45
(anonym) @ datatables.min.js:115
(anonym) @ datatables.min.js:45
(anonym) @ datatables.min.js:45
test.php:48 Uncaught TypeError: $(...).DataTable is not a function
at test.php:48

The PHP code does send data to be read by dataTable, but dataTable doesn't read them?

Debugger says all versions are updated.
No Error messages shown except for those under consol

Any ideas as what to do?

Best regards

Claus

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 14,086Questions: 25Answers: 3,322
    Answer ✓

    DataTables/datatables.min.css net::ERR_ABORTED 404
    DataTables/datatables.min.js net::ERR_ABORTED 404

    This means the server can't find these files.

    The PHP code does send data to be read by dataTable

    How is the data sent? Are you using the ajax option in Datatables? Where did you look to see that the data is sent?

    but dataTable doesn't read them?

    Maybe because of the 404 errors and Datatables code is not initialized? Does the table get formatted with the Datatables elements (like search)?

    Debugger says all versions are updated.

    Seems confusing if you are getting 404 errors.

    The Editor is independent of Datatables. Datatables manages the table data while the Editor manages the editing and updating of the backend.

    You can post a link to your page or PM Allan with the details for help with debugging. I would start by looking at the XHR request and response when fetching the table data. The next step is hard to say without knowing your configuration and how the table data is fetched and populated.

    Kevin

  • cha59cha59 Posts: 77Questions: 19Answers: 0

    Hi Kevin
    Thanks for your response
    Changed my links, so they now can find the files. Instead it tells me under consoll, that the version is to old, while the debugger says all are Ok.
    Here is a link: https://www.plearn.it/test/Editor/examples/cha_html/test.php
    Best regards
    Claus

  • cha59cha59 Posts: 77Questions: 19Answers: 0

    Hi Kevin
    I ran the PHP file on it's one
    , and it puts out this:
    {"data":[{"DT_RowId":"row_0","faggruppe":{"navn":" ","init":"ingen"}},{"DT_RowId":"row_1","faggruppe":{"navn":"\u00d8konomi og ledelse","init":"\u00d8L"}},{"DT_RowId":"row_3","faggruppe":{"navn":"Husdyr og planter","init":"HP"}},{"DT_RowId":"row_4","faggruppe":{"navn":"Natur og Milj\u00f8","init":"NM"}},{"DT_RowId":"row_6","faggruppe":{"navn":"Landskab og byggeri","init":"LB"}},{"DT_RowId":"row_8","faggruppe":{"navn":"\u00d8vrige","init":"\u00d8V"}},{"DT_RowId":"row_9","faggruppe":{"navn":"Timel\u00e6rere","init":"TI"}},{"DT_RowId":"row_12","faggruppe":{"navn":"Tv\u00e6rg\u00e5ende ressourcer","init":"TR"}}],"options":[],"files":[]}
    which looks fine to me.
    Best regards

  • cha59cha59 Posts: 77Questions: 19Answers: 0

    Hi
    How to contact Allan? What does PM Allan mean?
    Best regards
    Claus

  • kthorngrenkthorngren Posts: 14,086Questions: 25Answers: 3,322
    Answer ✓

    You are getting two errors:

    Uncaught Error: Editor requires DataTables 1.10.20 or newer

    If you put a breakpoint on line 48 you will see this error occurs before any of your Javascript code is executed. Seems the problem is in the Download Builder bundle. This is something @allan or @colin will need to look at. It seems the editor.js in the bundle, is trying to load before the datatable.js.

    Open the file ../DataTables/datatables.min.js and you will see a link to "Rebuild or modify...". Go to the link and remove the Editor from the list. Load the editor.js and .css files individually after loading the bundle. You should be able to find the files in the original download.

    Uncaught TypeError: $(...).DataTable is not a function
    at test.php:48

    You have this statment:

    var table = $('#example').DataTable();
    

    on line 48. Remove this line its not needed. Your Datatable initialization comes later in the $(document).ready() function.

    Kevin

  • cha59cha59 Posts: 77Questions: 19Answers: 0

    Thanks a lot Kevin
    Now it runs without any errors in consoll or debugger. But still no data?
    Any ideas?
    Best regards
    Claus

  • allanallan Posts: 54,881Questions: 1Answers: 8,601 Site admin
    Answer ✓

    Hi Claus,

    Thanks for the link above. Looking at it I can see an error on the console saying:

    Uncaught Cannot extend unknown button type: print

    That is because you are using the print button without the Print source code being loaded in. If you update the CDN URL you are using for DataTables to be:

    https://cdn.datatables.net/v/dt/jszip-2.5.0/dt-1.11.3/b-2.0.1/b-colvis-2.0.1/b-print-2.0.1/b-html5-2.0.1/cr-1.5.4/date-1.1.1/fc-4.0.0/fh-3.2.0/kt-2.6.4/r-2.2.9/rg-1.1.3/rr-1.2.8/sc-2.0.5/sb-1.2.2/sp-1.4.0/sl-1.3.3/datatables.min.js
    

    That particular issue will "go away" :).

    When you do that, hopefully data should load into your table as the response from the server looks okay.

    Allan

  • cha59cha59 Posts: 77Questions: 19Answers: 0

    Hi Kevin
    It works. You are a star. Thanks a lot for your help.
    Best regards
    Claus.

  • cha59cha59 Posts: 77Questions: 19Answers: 0

    Ups, now I see, that the latest answer was from you, Allan. You are also a star. Thanks a lot for your help.
    Best regards
    Claus

Sign In or Register to comment.