0

quick question. On my current project, content authors can select an expiration date for when a datasource item will become unpublishable. We are encountering an issue where once this date has elapsed, the datasource item will indeed be unpublished from the web database; however, the broken link guid will remain in the rendering component's datasource property on web (see below). This has been resulting in a null datasource error for our team.

Has anyone else encountered this? The publishing expiration date feature should be OOTB Sitecore, and thus, I'd assume should remove all links to an automatically unpublished item on web.

enter image description here

1 Answer 1

1

I'm afraid your assumption is incorrect.

That would require an event handler which would check all the references and change other items in web database directly. And direct changes in web database are not recommended.

Otherwise, if the change (datasource removal) would happen in master database, all linking items would have to be published. And you don't know if they are really ready to be published or maybe there is some work in progress happening there.

You need to make sure your code checks if item chosen as datasource really exists. And e.g. hide component if it doesn't.

1
  • So if an item in master is made unpublishable and then it and all related items are published, the items that link to the unpublishable item are expected to contain broken links? Jan 20, 2022 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.