Addresses #346, mapping for new item types
Fix for base field not being included (only type-specific fields) when searching by a base field
This commit is contained in:
parent
b1a025be92
commit
4ffaaa9eea
|
@ -582,9 +582,14 @@ Zotero.Search.prototype._buildQuery = function(){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add base field
|
||||||
|
condSQLParams.push(
|
||||||
|
Zotero.ItemFields.getID(condition['alias'])
|
||||||
|
);
|
||||||
var typeFields = Zotero.ItemFields.getTypeFieldsFromBase(condition['alias']);
|
var typeFields = Zotero.ItemFields.getTypeFieldsFromBase(condition['alias']);
|
||||||
if (typeFields) {
|
if (typeFields) {
|
||||||
condSQL += 'fieldID IN (';
|
condSQL += 'fieldID IN (?,';
|
||||||
|
// Add type-specific fields
|
||||||
for each(var fieldID in typeFields) {
|
for each(var fieldID in typeFields) {
|
||||||
condSQL += '?,';
|
condSQL += '?,';
|
||||||
condSQLParams.push(fieldID);
|
condSQLParams.push(fieldID);
|
||||||
|
@ -594,9 +599,6 @@ Zotero.Search.prototype._buildQuery = function(){
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
condSQL += 'fieldID=? AND ';
|
condSQL += 'fieldID=? AND ';
|
||||||
condSQLParams.push(
|
|
||||||
Zotero.ItemFields.getID(condition['alias'])
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user