I stumbled across what appears to be a bug in Sitefinity 7.1.5200. I was making a call to DynamicContent.GetDataItem(Type, Guid), and accidentally passed in an incorrect guid from a different item type. I expected GetDataItem to return null, since the guid does not exist for the Type that I passed in. Instead, it found the guid in the system under a different item type, and returned that one. I drilled down to the code for GetDataItem and found that the Type parameter is not being used.
public override DynamicContent GetDataItem(Type itemType, Guid id)
DynamicContent dataItem = Queryable.SingleOrDefault<
>((DataProviderBase) this, MethodBase.GetCurrentMethod()), (Expression<
<DynamicContent, bool>>) (p => p.ApplicationName == this.ApplicationName && p.Id == id)));
if (dataItem == null)
throw new ItemNotFoundException(Res.Get<
dataItem.Provider = (object) this;
Can someone please verify that this is incorrect behavior?