'Sequence contains more than one element' when calling getProperty
On a website running Umbraco 4.7.0, I sometimes get an error that puzzles me...
It happens when trying to get the "text"-property of a document by excuting this code:
var property = document.getProperty("text");
This code is executed quite often, so the error is in no way frequent, but twice in ten days now this has thrown a 'Sequence contains more than one element' exception like this:
[InvalidOperationException: Sequence contains more than one element] System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +6383080 umbraco.cms.businesslogic.Content.getProperty(PropertyType pt) +137
The problem is fixed by republishing the document, but I can't figure out how it can happen. Has anybody encountered something similar, and maybe found a way around it or know how it can occur?
'Sequence contains more than one element' when calling getProperty
On a website running Umbraco 4.7.0, I sometimes get an error that puzzles me...
It happens when trying to get the "text"-property of a document by excuting this code:
This code is executed quite often, so the error is in no way frequent, but twice in ten days now this has thrown a 'Sequence contains more than one element' exception like this:
The problem is fixed by republishing the document, but I can't figure out how it can happen. Has anybody encountered something similar, and maybe found a way around it or know how it can occur?
Any input is welcome.
Don't you have to use document.getProperty("text").Value ?
Yes. The line is followed by
and that's the end of the method that should return the text. The exception must come from inside either .getProperty or .Value...
EDIT: nevermind ;)
is working on a reply...