cheesegrits
Support Gopher
Yes, the calc gets eval'ed multiple times on submission. That's not a surprise, as it gets run a a result of the element's getValue() method (which calls _getV(), which does the actual eval), which is called in multiple places - the preProcess phase, validation, final database store formatting, then potentially in things like getEmailValue() during onAfterProcess hooks (like email plugin).
I could experiment with putting caching in there, in _getV(), although if I recall correctly we used to do that, and it caused problems. But I can't offhand remember what the problem was. But probably worth trying again, as this was quite some time ago, and we may have resolved whatever wrinkle it was that was that caching was clashing with.
However, in all of my testing, the raw and non-raw values for a read-only join placeholder are what I would expect at each run through _getV().
-- hugh
I could experiment with putting caching in there, in _getV(), although if I recall correctly we used to do that, and it caused problems. But I can't offhand remember what the problem was. But probably worth trying again, as this was quite some time ago, and we may have resolved whatever wrinkle it was that was that caching was clashing with.
However, in all of my testing, the raw and non-raw values for a read-only join placeholder are what I would expect at each run through _getV().
-- hugh