-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MNTP: Exception with orphan node IDs #1
Comments
GetObjectType should return null for a deleted nodeId, if it's throwing then it's a core bug :) I'll have a look at core but probably best to add a try catch if it's throwing currently. |
@tomfulton I've tried to replicate with a unpublished and deleted node without success, any tips on how to replicate? |
Hey @Jeavon, I can replicate by passing a non-existing ID to: ApplicationContext.Current.Services.EntityService.GetObjectType(3333333); I was also able to reproduce in the Umbraco UI (7.1.6). It should happen once you delete the node from the Recycle Bin, and it's still selected on an MNTP. Is it not happening for you? I think you're right that the core shouldn't throw for this, but even if they don't we may still have the same issue. Right now the PVC relies on this method to figure out what type of nodes it should request/return (Document/Media/Member). If the first node ID in the list is invalid (this was my case), the PVC won't know how to process the rest. Maybe if the first ID doesn't exist, we fallback to the next, and so-on? And if all are invalid we return an empty list? |
Fixed (worked around) in v2.1.3 |
@Jeavon Thanks, works like a champ! 🍻 Hope to see this fixed in the core too. I'm following your pull request and U4-5698, nice work! |
Me too, think my workaround isn't very efficient but now I have a good fix for core, so hopefully Umbraco v7.2.1 I can revert :) |
One of my MNTP's has references to a node that no longer exists, which seems to cause the below exception when attempting to access:
I think the exception is coming from the EntityService since we're passing it an invalid node ID.
I started to look at fixing this but wasn't sure how else we'd determine the
UmbracoObjectType
- other than a loop with some try/catches 😬Any ideas, have you ran into this before?
The text was updated successfully, but these errors were encountered: