How to avoid the problem that deletes an image that is tied to a content and is a mandatory field of the document type is eliminated and in the content the image is as trashed.
As valid that the image always exists and is not as deleted.
this will add additional functionality to Umbraco, that should give you a warning if you try to delete things, when they are used in other parts of Umbraco.
Exactly that is what I would like to prevent from happening.
It would be excellent if umbraco implemented this functionality as something native.
Although it seems the best thing is always to verify that the image is not null to avoid problems of type "Object reference not set to an instance of an object."
I appreciate your response and I will take a look at the recommended package.
I just encountered this issue with a live site. An image tied to a post was deleted from the media folder causing the news feed to throw a null reference error when it accessed the post with the missing image. I resolved the issue by restoring the image from the recycle bin. I'm using Umbraco version 8+ which I don't think the Nexu package is compatible with. Any other suggestions for this issue?
Image deleted in media tied to content
Hello community
How to avoid the problem that deletes an image that is tied to a content and is a mandatory field of the document type is eliminated and in the content the image is as trashed.
As valid that the image always exists and is not as deleted.
Thanks
Hi Daniel
Have a look at this packaged called 'nexu'
https://our.umbraco.com/packages/backoffice-extensions/nexu/
this will add additional functionality to Umbraco, that should give you a warning if you try to delete things, when they are used in other parts of Umbraco.
I think that is the problem you are describing?
It's a good package to look at anyway :-)
regards
Marc
Hi Marc.
Exactly that is what I would like to prevent from happening.
It would be excellent if umbraco implemented this functionality as something native.
Although it seems the best thing is always to verify that the image is not null to avoid problems of type "Object reference not set to an instance of an object."
I appreciate your response and I will take a look at the recommended package.
regards
Daniel B.
Yes
That and always checking for nulls :-P
I just encountered this issue with a live site. An image tied to a post was deleted from the media folder causing the news feed to throw a null reference error when it accessed the post with the missing image. I resolved the issue by restoring the image from the recycle bin. I'm using Umbraco version 8+ which I don't think the Nexu package is compatible with. Any other suggestions for this issue?
Hi Dean
The best defence is to always check for nulls.
So if you have an implementation for a News Story that has a Media Picker to pick the main image you might have something like
The danger here is if the picked image has been deleted, the relatedImage object will be null and the call to .Url will throw an error.
will not throw an error, because before we try to access the Url property we check first if the object is null...
Umbraco 8.6 will include 'Media Tracking' in a similar fashion to the Nexu package - https://umbraco.com/blog/umbraco-product-update-january-29th-2020/ so it will be easier to see if a Media item is in use before deleting it!
There was an early content app for V8 that tracked where Nodes were used: https://our.umbraco.com/packages/backoffice-extensions/linked-nodes-content-app/
regards
Marc
I thought I did but I guess I missed a reference to an image for most recent articles in a partial used for the footer. Fixed now. :-)
is working on a reply...