Jump to content
thirty bees forum

Product downloads controller reviewed


Recommended Posts

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.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...