Quoting [iaresean](https://www.codeplex.com/site/users/view/iaresean) from thread https://compositec1.codeplex.com/discussions/446557
When using a media selector widget to populate a function that has an IMediaFile parameter I initially get a "< data reference >" error message in the control after selecting a media file.
I am sourcing from a custom media store and provider, so this may be the issue.
I think it could possibly be an issue with the DataReferenceTreeSelector.ascx form control.
```
static bool TryExtractMediaId(string value, out Guid mediaId)
{
if(value.Contains("="))
{
return Guid.TryParse(value.Substring(value.LastIndexOf("=") + 1), out mediaId);
}
if(value.StartsWith("~/media(") && value.EndsWith(")"))
{
int openingBracketOffset = value.IndexOf("(");
int closingBracketOffset = value.IndexOf(")");
string guidStr = value.Substring(openingBracketOffset + 1, closingBracketOffset - openingBracketOffset - 1);
return Guid.TryParse(guidStr, out mediaId);
}
mediaId = Guid.Empty;
return false;
}
```
The media urls that I am providing need to have my custom store identifier included, but it doesn't look like this method takes that into account?
Comments: fixed in the latest build, available in the latest check-in
When using a media selector widget to populate a function that has an IMediaFile parameter I initially get a "< data reference >" error message in the control after selecting a media file.
I am sourcing from a custom media store and provider, so this may be the issue.
I think it could possibly be an issue with the DataReferenceTreeSelector.ascx form control.
```
static bool TryExtractMediaId(string value, out Guid mediaId)
{
if(value.Contains("="))
{
return Guid.TryParse(value.Substring(value.LastIndexOf("=") + 1), out mediaId);
}
if(value.StartsWith("~/media(") && value.EndsWith(")"))
{
int openingBracketOffset = value.IndexOf("(");
int closingBracketOffset = value.IndexOf(")");
string guidStr = value.Substring(openingBracketOffset + 1, closingBracketOffset - openingBracketOffset - 1);
return Guid.TryParse(guidStr, out mediaId);
}
mediaId = Guid.Empty;
return false;
}
```
The media urls that I am providing need to have my custom store identifier included, but it doesn't look like this method takes that into account?
Comments: fixed in the latest build, available in the latest check-in