Updated weird case path adding a sensible result and logging a warning

This commit is contained in:
Giulio Cesare Solaroli 2015-07-29 17:34:20 +02:00
parent 0dbd7eb45a
commit cbc613da7f
2 changed files with 5 additions and 2 deletions

View File

@ -581,7 +581,8 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
result = someFilteredResults[0]; result = someFilteredResults[0];
break; break;
default: default:
WTF = TODO; console.log("Warning: Record.fieldWithLabel('" + aLabel + "') is returning more than one result: " + someFilteredResults.length);
result = someFilteredResults[0];
break; break;
} }

View File

@ -681,6 +681,7 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, {
], {trace:false}); ], {trace:false});
}, },
*/ */
'recordWithLabel': function (aLabel) { 'recordWithLabel': function (aLabel) {
return Clipperz.Async.callbacks("User.recordWithLabel", [ return Clipperz.Async.callbacks("User.recordWithLabel", [
MochiKit.Base.method(this, 'getRecords'), MochiKit.Base.method(this, 'getRecords'),
@ -701,7 +702,8 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, {
result = someFilteredResults[0]; result = someFilteredResults[0];
break; break;
default: default:
WTF = TODO; console.log("Warning: User.recordWithLabel('" + aLabel + "') is returning more than one result: " + someFilteredResults.length);
result = someFilteredResults[0];
break; break;
} }