Ricardo Kustner wrote:
Discussion list for developers <[email protected]> on Friday,
July 22, 2005 at 1:09 PM +0100 wrote:
The editwizards are using the Dove API to receive and send data to
MMbase. The put command of Dove requires the old and new values of the
nodes. Dove throws your error when the old values don't match the data
in mmbase.
Are pre or postprocessing the 'linktext' field for example in a builder
file?
I'm not sure if I understand what you mean, but the only place where these
nodes are changed is through the editwizards.
Is it theoretically possible that something went wrong in an EW session,
which caused the transaction to be incomplete and leave a node in an
"unstable" state?
This is the piece of code which is causing your problems.
String originalValue = (String)originalValues.get(key);
String mmbaseValue;
if (node.getNodeManager().getField(key).getType() == Field.TYPE_DATETIME) {
mmbaseValue = "" + node.getDateValue(key).getTime() / 1000;
} else {
mmbaseValue = node.getStringValue(key);
}
if ((originalValue != null) && !originalValue.equals(mmbaseValue)) {
// give error node was changed in cloud
The originalValue is the fieldValue when the node was loaded into the
editwizard. The mmbaseValue is the fieldValue at the time this piece of
code is executed.
I see two ways it can go wrong. I haven't checked the rest of the code
so I don't know which one it is.
1. mmbaseValue = null and originalValue = "". Maybe the code converts a
null somewhere to a "" value?
2. If the Strings are one character (eg a \n) different from eachother.
The node.getStringValue() calls a Processor when that is defined for a
guitype. The getStringValue() does also call the get-methods in a
Builder class file. I guess, there is a small change that the
getStringValue() returns 2 different Strings and the equals will fail.
Or the String changed by writing and reading it from a dom document in
the editwizard.
What is the guitype in the builder for the field linktext? Does the
builder have a custom class? How does your wizard definition look like?
Nico
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers