Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    This issue is not caused by the update actually. Things were actually broken before already. You did just not see that error message as the old version simply failed silently. After the update, the DataTables JS library is showing that error message, to make it easier for people to spot mistakes.

    The cause for the issue is the “Custom Commmand” that you are using for the table, and which is looking like this at the moment:

    "columnDefs": [ { "type": "alt-string", "targets": [ 0,1,2,3,4,5,6,8,9,10,11,] } ]

    That command references columns 1 through 12, but the table only has six columns. Due to that, the JS library runs into an error. The fix is pretty easy: Just change that “Custom Command” to

    "columnDefs": [ { "type": "alt-string", "targets": [ 0, 2, 3 ] } ]

    Note how I changed the list of columns to only those that actually have an image in them (and don’t forget that counting starts with 0).
    After that change, the error should be gone, and everything should be working again ??

    Regards,
    Tobias

    Thread Starter nwalker

    (@nwalker)

    Thanks Tobias, I have just noticed that these custom commands have been copied across from one of my tables to all of my tables. Must have been when the update happened as all my tables now have DataTables switched on when they didn’t to beging with.!! I’m going to restore everything back pre upgrade, backup the tables and then do the upgrade to see if I get a clean install!
    .

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    I don’t see how the update could have copied the “Custom Commands” to all tables, to be honest, but I’ll check the code again.
    Could it be possible that it got copied when you copied a table to start working on the next one?

    Regards,
    Tobias

    Thread Starter nwalker

    (@nwalker)

    I did a restore and all worked fine again.

    I went through each table and about a third of them had the dubious commands in them. It’s possible that I had transferred them across when creating them. However it doesn’t explain how the data tables for those got “switched on” as part of the upgrade.
    Still I’ve fixed it all now, thanks for the insite as it enabled me to clean things up a bit.

    Thanks for your help, I hope you didn’t spend too much time doing a code review.

    All the best
    Neil.

    Thread Starter nwalker

    (@nwalker)

    I upgraded successfully and all works as before ??

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no worries, you are very welcome! ?? Good to hear that this is fixed!
    I also checked the code again and repeated the update process on a fresh development site, but checkbox remained as it was before the update… Really weird that this happened on your site…

    Best wishes,
    Tobias

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘TablePress version 1.5.1 has broken my tables!!’ is closed to new replies.