bugfix in Document.prototype.getFields(): don't use getField(), as this returns only the first of multiple fields with the same name

This commit is contained in:
grob 2008-04-10 09:55:03 +00:00
parent 7e267af7fd
commit f1577494a6

View file

@ -1154,8 +1154,8 @@ helma.Search.Document.prototype.getField = function(name) {
var f = this.getDocument().getField(name); var f = this.getDocument().getField(name);
if (f != null) { if (f != null) {
return new helma.Search.Document.Field(f); return new helma.Search.Document.Field(f);
} }
return null; return null;
}; };
/** /**
@ -1168,7 +1168,7 @@ helma.Search.Document.prototype.getFields = function() {
var size = fields.size(); var size = fields.size();
var result = new Array(size); var result = new Array(size);
for (var i=0; i<size; i+=1) { for (var i=0; i<size; i+=1) {
result[i] = this.getField(fields.get(i).name()); result[i] = new helma.Search.Document.Field(fields.get(i));
} }
return result; return result;
}; };