Orphaned images in web-links

If you aren't speaking german, you can ask for support or post your request here.
Antworten
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Orphaned images in web-links

Beitrag von Schwartz »

When You have a weblink where You have made some text and an image - and You then later "delete" or replace the image, then You no longer have an entry in the database, but You still have the image in the image-folder in Admidio-files/weblinks.

By time there could be many of these orphaned images.

Could there be a routine where these orphaned images were presented, and You had the possibility with a red X, to delete them ?
Benutzeravatar
fasse
Administrator
Beiträge: 6075
Registriert: 12. Nov 2005, 16:06

Re: Orphaned images in web-links

Beitrag von fasse »

You are right. That's a problem. But therefore we must identify the ophaned images. This will be the challenge. After that we could delete them without user input.

But until now we doesn't have a routine to identify them.
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Orphaned images in web-links

Beitrag von Schwartz »

Hello fasse

I will test some in the downloads - I mean I have seen something there.
I mean to have seen some entries that was presented as not belonging to a download and that could be deleted by clicking a red X.
But I am not sure - maybe this is another story ?
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Orphaned images in web-links

Beitrag von Schwartz »

I tried to FTP a file to download folder.
Then - when I in ADMIDIO look in this folder, then there in the bottom is a list ( well - there is only one but there could have been more )
On top of the list it says "Nicht verwaltete Dateien"

I was wrong about the red X - there is a possibility "Zur Danenbank Hinzufügen".

But for the web-links it could be a red X AND/OR - a possibility to "Remove all Orphaned ?"
Benutzeravatar
fasse
Administrator
Beiträge: 6075
Registriert: 12. Nov 2005, 16:06

Re: Orphaned images in web-links

Beitrag von fasse »

Yes, I know the feature within the download module, but this is a complete different function because within the download module every file has a reference in the database and if not we could show them as you described.

The uploaded images have no reference in the database. They have a text link within a full text. And there are also some other differences ...

But yes it's possible to implement this feature but there must be someone who writes this new routine ...
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Orphaned images in web-links

Beitrag von Schwartz »

Hello Fasse

I have tried to use the photo-module, but here I ran into some other troubles - so I was forced to stay with the weblinks.
I then had an expert to help me, with the technical stuff ( the author of the great free web-calendar LuxCal
http://www.luxsoft.eu/ ).
We have made a script that identifies ( and deletes when wanted ) files that is not "mentioned" in the database or files that are not image-files.
The script is for weblinks/images but could very easily be adapted to announcements/images and dates/images.
The pin-code in the script can be edited so no unwanted can delete the files.
The script can be renamed so no unwanted can start the script ( at least he has to find the name ).
The script should reside in the ADMIDIO folder ( or be modified reg. the rel. paths)
It would be great if you would implement the script in ADMIDIO, and eventually put it where the backup-routine is, or make a maintenance routine, where you could start 3 scripts ( weblinks, announcements and dates ) with pin-codes delivered from a setting in ADMIDIO.
I attach the script - feel free to use it in ADMIDIO. Now that I have followed your call to make a script, I hope you will follow mine - to implement the script in ADMIDIO.
The script is tested.
Kind regards
Schwartz
Dateianhänge
purgeawis.zip
(1.98 KiB) 223-mal heruntergeladen
Benutzeravatar
fasse
Administrator
Beiträge: 6075
Registriert: 12. Nov 2005, 16:06

Re: Orphaned images in web-links

Beitrag von fasse »

Hi Schwarz,

thanks for the script, but this is a separate script/function that is not integrated within our Admidio logic. You could create a plugin zip file and we can host this plugin on our page if you like.


To implement a function in Admidio implement you logic if we delete an entry. Than scan the description and delete the file. Therefore I create an issue https://github.com/Admidio/admidio/issues/683

Best regards
Fasse
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Orphaned images in web-links

Beitrag von Schwartz »

Hello Fasse

I think it could be a good idea, to have it in plugins, as it could help those who use the weblinks.

I will then make some text as a proposal to what could be the text for this "plugin" - should I proceed on this thread or use the message system ?

Even when you in future will delete the files when deleting a database entry, the problem will still be there. When you have an entry and then on that entry simply delete an image ( deliberately or not deliberately ) then the name is no more in the entry but the image file is still there. So the problem is not solved 100 %

And my solution is only a 100 % solution for those who ONLY uses the weblinks and not the dates and announcements.

If the cleaning should be 100 % then all 3 should be covered. If I make 3 routines or one routine to cover it all - is there some rules that should be followed ? As it is now, the script should be run from the admidio folder - should it be from a adm_plugins/cleaning folder or is the admidio folder OK ?
Is it okay to have it only in English as it is now ?

Will You deliver the script in the ADMIDIO package or do people have to download separately ?

As I see it, the script will not be sensitive in case of new versions, but will be functional also in the future, and I think it will be a good idea to have it as a long-living ADMIDIO product. If you agree I will try to make it "nice" and "correct"- else I will make no more, or maybe a quick-and-dirty and simply make 2 edited copies for the dates and announcements.

Kind regards
Schwartz
Antworten