I think its quite common for various
pieces of code in Sitecore to climb the item hierarchy up, seeking
some inherited wisdom. A less common scenario, however, is to have a
parent which is less visible than its child.
home
|
--news
|
--news item
(please bear with my advanced graph
engine)
Imagine that you're not allowed to see
the news section, but individual news items are just fine - either by
mistake, or deliberately. So what happens if you have a code that
goes up the tree ? (think breadcrumb)
Item item = this;
while (item != null)
{
Collect(item.Fields["Menu
Title"].Value);
item = item.Parent;
}
You'll start with news item, which is
fine. Then you go up to the news section, trying to read its field..
and get an exception, with a pretty clear message. That item that you
don't have access to is considered to be "BrowseOnly", and
reading fields of browse only items is bad.
To avoid seeing that exception in
future, you need to add a guard clause looking for
item.RuntimeSettings.BrowseOnly.
Hopefully this one stops biting me now.