·
Added a discussion

I'm researching how the persons_pictures table(s) are populated and just noticed when photos in the Photos module are delete OR when a profile with photos is deleted, the appropriate tables keep the image data and the file remains in the assigned directory.  Perhaps there is some kind of cleanup utility that runs later, independent of the "delete" submissions in the Photo module or when a profile is complete?  

  • 1167
Comments
    • As I know the cron job is making the cleanings.

      • Would like to get a confirmation on a cron deleting images and wonder why it was built that way.

        Also, I would rather use an avatar image instead of the first character of the name as the default profile icon.  What is and how do I call the function to add a new image?

        • Some operations delete files immediately - usually when only one file is deleted, while other files delete operations are postponed - usually when several files needs to be deleted. 

          When profile is deleted then profile could have many files, so this operation is postponed. You can check `sys_storage_deletions` table to see if files were queued for deletion after profile removal.

          • Good to know, thank you.  What function would I call if I wanted to upload an image for a profile that didn't have a default picture?  For example, on join... instead of using the first letter of the name as an avatar.

            • There are several methods, which need to be called, first you need to upload image to the Storage:

              https://ci.una.io/docs/classBxDolStorage.html

              Then you need to associate added file with the profile by calling

              updateContentPictureById from profile module DB class

              Login or Join to comment.