Product downloads controller reviewed

  • Over the last couple of days I reviewed the product downloads controller in order to give it a more reliable shape. This includes a number of changes to the ProductDownload class, none of which should affect behavior for other uses.

    It’s this thing, part of the product editor:

    0_1506435445682_Bildschirmfoto am 2017-09-26 um 16.14.42-fullpage.png

    Changed and new features:

    • Deleting the file deletes the file only, not the entire product download record. As one would expect when clicking ‘Delete this file’.
    • Removing the file associated to the product still removes both, file and record.
    • Deleting one record no longer creates yet another, empty record.
    • Switching product type away from ‘Virtual Product’ also deletes file and product download record. Keep the environment clean, folks! 🙂
    • There is now a new switch for deactivating a download. Previously the other switch tried to handle this as well … and more often than not produced a mess.
    • If there’s something wrong with the downloadable file (missing file, missing name), a product download gets deactivated automatically. To make sure your customers see only working downloads.
    • Catched all cases of product download records being deleted without the related file being deleted as well. No more stale file in the downloads folder of your server. Well, hopefully 🙂

    If you want to give it a try, code is currently on the productdownloads branch for evaluation. If there are no objections coming up, I’ll move it to 1.0.x in a few days.

    P.S.: ‘record’ = database entry into the tb_product_download table.

  • @Traumflug That was a huge undertaking. No wonder we keep you around 👍🏻😁

  • What is missing for the second precision? Just the frontend widget?

    As far as I could see, it’s the formatting requested for the datepicker in the GUI and also some PHP code assuming this format. PHP code for second-precision exists in a comment already.


Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.