On Wed, 2007-05-09 at 12:14 +0200, Norbert Hartl wrote:
Hi,
I have an image object which references a user. For
the user there is a descriptionContainer which adds
conditions for the user (checks equality of password).
In a component dealing with the image there appears
something strange. If I do a validate on that component
it complains abaut value cache being unknown. And this
is coming from the descriptionContainer of the user
object. Is it normal for the referenced objects to be
checked as well? Or do I misunderstand something?
I narrowed the problem a bit.
I have
User class>>descriptionContainer
| user |
^ super descriptionContainer
addCondition: [
:value |
(
(value cache at: self descriptionPassword ifAbsent: []) =
(value original at: self descriptionPassword ifAbsent: []))
ifFalse: [
(value cache at: self descriptionPassword ifAbsent: []) =
(value cache at: self descriptionPasswordMatch ifAbsent: [])
] ifTrue: [
true
]
]
I have objects which reference an Image. The image itself references
a user. If I edit the user object I get a MACheckedMemento for the
value in the condition. If I edit an object which references the
image there are two possibilities. If I upload a new image (which
creates a new image and assigns it a user) everything is fine. If I
leave the image upload field empty I get a "User DNU cache". Looking
at the value in the condition it is of type User.
Is Magritte always checking the complete tree of referenced objects.
This is often undesirable, e.g. if I assign an object which is an
existing one and therefor has been checked already.
How can it happen that that condition gets the real object as a value
instead of the memento? In the failure case I do not invoke self value:
at all. So I'm sure not to store anything strange.
Norbert