I think I found what caused the problem.
The content was currently being edited, and was not published (You can see in the OP picture that the content has the status 'Draft').
I guess there is some kind of lock that could prevent Umbraco.Content from returning the content.
After I published the changes, the Umbraco.Content function could return the content without any issues.
The “lock” is that Umbraco.Content can only find published content.
This is intended behaviour, to prevent you from displaying content that is not ready. You can easily have drafts while another revision is still published.
Umbraco.Content(id) returning null
Hi, I'm new to Umbraco, and am trying to present a picture from the property of a content.
In my view, I am simply trying to select the content and render the media property:
But for some reason Umbraco.Content returns null.
I've checked if the content currently has the id '1067', which it has:
I also checked the database:
The weird thing is that it could find the content yesterday, so the Umbraco.Content seems inconsistent to me.
I think I found what caused the problem. The content was currently being edited, and was not published (You can see in the OP picture that the content has the status 'Draft'). I guess there is some kind of lock that could prevent Umbraco.Content from returning the content.
After I published the changes, the Umbraco.Content function could return the content without any issues.
The “lock” is that Umbraco.Content can only find published content.
This is intended behaviour, to prevent you from displaying content that is not ready. You can easily have drafts while another revision is still published.
is working on a reply...