• Resolved bayerjeff

    (@bayerjeff)


    I run a film review website.
    I’m using TablePress for the database.
    https://thescorecardreview.com/film-review-database
    Everything was working great, but now the additional Custom Commands our programmer created is not saving in the “Custom Commands” section.
    Before, it would format the date, and it would also create a link from the movie_post_id column our programmer created.
    The current links are ones I added to link to a different type of review (audio vs written). Hiding or unhiding the columns doesn’t fix the issue.

    Now, if we save the Custom Commands, they will be there, but if we re-open the table, the code is gone. Below is the code that is ALWAYS in the Custom Commands, followed by our code. Do you have any advice? Could we save the code in the ftp drive folders anywhere? Do you think the Table is simply too big (it loads very slowly) and that could be causing the error? I’ve loved TablePress, hope we can continue using it, and looks forward to donating once this issue is figured out. Here is the code (yours and mine) …

    “columnDefs”:[{“fnRender”:function(oObj){if (typeof oObj.aData[0] !== “undefined” && oObj.aData[0].length>0){return ““+oObj.aData[2]+”“;}else{return oObj.aData[2];}},”bUseRendered”:false,”targets”:[2]},{“visible”:false,”targets”:[0]},{“fnRender”:function(oObj){return oObj.aData[1].replace(/(\d\d\d\d)-(\d\d)-(\d\d)/,”$2/$3/$1″);},”bUseRendered”:false,”targets”:[1]}],”autoWidth”:false

    “aoColumnDefs”:[{“fnRender”:function(oObj) {if (typeof oObj.aData[0] !== “undefined” && oObj.aData[0].length > 0) {return “” + oObj.aData[1] + ““;} else {return oObj.aData[1];}},”bUseRendered”:false,”aTargets”:[1]},{“bVisible”:false,”aTargets”:[0]},{“fnRender”:function(oObj) {return oObj.aData[3].replace(/(\d\d\d\d)-(\d\d)-(\d\d)/, “$2/$3/$1″);},”bUseRendered”:false,”aTargets”:[3]}],”bAutoWidth”:false

    Sincerely,

    Jeff Bayer

    https://www.ads-software.com/plugins/tablepress/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi Jeff,

    thanks for your question, and sorry for the trouble.

    I’m not exactly sure that I understand the issue.

    The first piece of code that you posted is what’s in the “Custom Commands” field, right now, from what I can see. It’s basically the modernized version of your second piece of code (which still uses the syntax of the old version 1.9 of the DataTables JS library).
    Now, I’m not too familiar with the exact details of what your code does, but it is possible that it might also need some modifications to work with the latest DataTables 1.10. Maybe your developer can check that.

    Saving that JS code in the plugin folder is not possible, you would have to turn it into a small custom TablePress Extension (the outcome would however be the same as using the “Custom Commands” textfield).

    Regards,
    Tobias

    Thread Starter bayerjeff

    (@bayerjeff)

    Sorry, yes, the entire code is ours.

    The main issue is that when we change the “Custom Commands” textfield and click save, it doesn’t actually update the field.

    My developer said it’s possible that neither of the two pieces of code posted will actually work, and he can work on that. The problem is that since nothing new that he puts into the field gets saved, it’s impossible for him to try anything to fix it. He said he clicks save, the UI says the settings are saved, but then when he comes back to the page, the old “Custom Commands” code is still there instead of the new code.

    He even tried to find a database entry where this code is saved to see if he could modify it there manually, but couldn’t find it.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ah, thanks for the clarification. Now I understand what you mean.
    This is really strange, and I don’t really have an explanation for a behavior like this.
    Does the same happen when you try to edit the “Custom Commands” textfield with your user account? What role is the account of your developer? Is he an “Administrator”?

    Regards,
    Tobias

    Thread Starter bayerjeff

    (@bayerjeff)

    Tobias –

    Thank you for the help so far. He is an administrator. I’ve noticed if you delete the code, it will remain blank when you re-open the page. So it appears the plug-in is still capable of saving, but when I insert the entire code, the second half of it — starting with “aoColumnDefs” — disappears.

    – Jeff

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ok, I think there’s just some confusion here about the conversion of the old DataTables syntax to the new one. For example, "aoColumnDefs" will automatically be converted to "columnDefs" (according to the list at https://www.datatables.net/upgrade/1.10-convert ).
    Does this make sense?

    Regards,
    Tobias

    Thread Starter bayerjeff

    (@bayerjeff)

    Tobias –

    This makes perfect sense. My developer updated everything and now it is working wonderfully.
    https://thescorecardreview.com/film-review-database

    Thank you for your time and patience. It is a fantastic plug-in.

    – Jeff

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped! Looks very nice on your site!
    And thanks again for the donation, I really appreciate it!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom Commands not saving’ is closed to new replies.