문제

I am working on a sitecore site rev 120706 DMS and main.

We are adding personas to some pages and getting unusual results with fractional values when we try to add to them using the Score(string, float) method. we have a value lead which is 0.5 due to two profiles being added to an earlier page one with a value of 1 and another with a value of 0. On a form submission we want to add one to the value and use Profile.Score("lead", 1) which replaces the .5 with a 1 instead of adding 1 to get 1.5 . When the value is 1 we are successfully getting 2.

How can we get the Score method to react in a consistent matter?

도움이 되었습니까?

해결책

Sitecore apparently has an issue in their code with it using int.Parse instead of float.Parse

I've found place in the code where the error appears. It's in the Sitecore.Analytics.Data.VisitProfile.Parse() method. It uses int.Parse instead of float.Parse while reading profile values from database. This issue was fixed in Sitecore 6.6.0 Update-4. Please see reference number 376088 in release notes. Unfortunately, there is no easy way to fix the code. Please consider upgrading your solution to 6.6.0 Update-4. In the meantime I would suggest to use larger score values in your profiles, so that resulting value is always be greater than 1. This approach works on my side. Please let us know in case you have any troubles with that.

To resolve the issue ended up just multiplying the values we were using by 10 to avoid sitecore's int as opposed to float issue.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top