Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Yes, you need to set up a cron that scans the database for records that are older than your time limit, then deletes them. It’s best to set this up as a custom plugin.

    The plugin can’t do this without your own custom code.

    Thread Starter ranone

    (@ranone)

    Tks for your reply @xnau!

    Which way is the correct one to delete a record and all its dependencies of a PDB record in the database? including linked upload files…

    Regards

    Plugin Author xnau webdesign

    (@xnau)

    There is no method like this in the plugin, the plugin does not delete uploaded files when a record is deleted.

    What you will need to do is look at the record data before you delete it, find all the filenames, and delete each one.

    You can delete a file with something like this:

    <?php
    $filepath = trailingslashit( Participants_Db::files_path() ) . $filename;
    unlink( $filepath );
    ?>
    Thread Starter ranone

    (@ranone)

    Hi,
    writing some custom code, I saw that the fields deleted from the back office are actually still present in the database (mysql, access with phpmyadmin)…

    Is there any way to clean up these ghost fields?

    Tks

    Plugin Author xnau webdesign

    (@xnau)

    Referring to columns in the main database? Yes, those are not deleted when a field is deleted, you can clean those up by deleting them manually. The reason they are not deleted is to prevent accidental data loss. Normally, this is not much of an issue, but if there has been a lot of fields deleted, it’s a good idea to remove those columns.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Auto delete record older 48h’ is closed to new replies.