diff --git a/chrome/content/zotero/preferences/preferences.xul b/chrome/content/zotero/preferences/preferences.xul
index b4cf8a46e..f6980daed 100644
--- a/chrome/content/zotero/preferences/preferences.xul
+++ b/chrome/content/zotero/preferences/preferences.xul
@@ -64,6 +64,7 @@ To add a new preference:
+
@@ -148,6 +149,7 @@ To add a new preference:
+
diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js
index 66977ff85..252bce35a 100644
--- a/chrome/content/zotero/xpcom/collectionTreeView.js
+++ b/chrome/content/zotero/xpcom/collectionTreeView.js
@@ -1449,7 +1449,7 @@ Zotero.CollectionTreeView.prototype.drop = function(row, orient)
// DEBUG: save here because clone() doesn't currently work on unsaved tagged items
var id = newItem.save();
newItem = Zotero.Items.get(id);
- item.clone(false, newItem);
+ item.clone(false, newItem, false, !Zotero.Prefs.get('groups.copyTags'));
newItem.save();
//var id = newItem.save();
//var newItem = Zotero.Items.get(id);
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js
index 9faf5d97e..21ec40378 100644
--- a/chrome/content/zotero/xpcom/data/item.js
+++ b/chrome/content/zotero/xpcom/data/item.js
@@ -3873,18 +3873,23 @@ Zotero.Item.prototype.multiDiff = function (otherItems, ignoreFields) {
/**
* Returns an unsaved copy of the item
*
- * @param {Boolean} [includePrimary=false]
- * @param {Zotero.Item} [newItem=null] Target item for clone (used to pass a saved
- * item for duplicating items with tags)
- * @param {Boolean} [unsaved=false] Skip properties that require a saved object (e.g., tags)
+ * @param {Boolean} [includePrimary=false]
+ * @param {Zotero.Item} [newItem=null] Target item for clone (used to pass a saved
+ * item for duplicating items with tags)
+ * @param {Boolean} [unsaved=false] Skip properties that require a saved object (e.g., tags)
+ * @param {Boolean} [skipTags=false] Skip tags (implied by 'unsaved')
*/
-Zotero.Item.prototype.clone = function(includePrimary, newItem, unsaved) {
+Zotero.Item.prototype.clone = function(includePrimary, newItem, unsaved, skipTags) {
Zotero.debug('Cloning item ' + this.id);
if (includePrimary && newItem) {
throw ("includePrimary and newItem parameters are mutually exclusive in Zotero.Item.clone()");
}
+ if (unsaved) {
+ skipTags = true;
+ }
+
Zotero.DB.beginTransaction();
// TODO: get rid of serialize() call
@@ -4024,7 +4029,7 @@ Zotero.Item.prototype.clone = function(includePrimary, newItem, unsaved) {
}
}
- if (!unsaved && obj.tags) {
+ if (!skipTags && obj.tags) {
for each(var tag in obj.tags) {
if (sameLibrary) {
newItem.addTagByID(tag.primary.tagID);
diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js
index b89387b44..fafbe920a 100644
--- a/chrome/content/zotero/zoteroPane.js
+++ b/chrome/content/zotero/zoteroPane.js
@@ -1463,7 +1463,7 @@ var ZoteroPane = new function()
var id = newItem.save();
var newItem = Zotero.Items.get(id);
- item.clone(false, newItem);
+ item.clone(false, newItem, false, !Zotero.Prefs.get('groups.copyTags'));
newItem.save();
if (this.itemsView._itemGroup.isCollection() && !newItem.getSource()) {
diff --git a/chrome/locale/en-US/zotero/preferences.dtd b/chrome/locale/en-US/zotero/preferences.dtd
index 78b2f0cc5..8fc05f263 100644
--- a/chrome/locale/en-US/zotero/preferences.dtd
+++ b/chrome/locale/en-US/zotero/preferences.dtd
@@ -38,6 +38,7 @@
+
diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js
index a8473dbf6..f207afe36 100644
--- a/defaults/preferences/zotero.js
+++ b/defaults/preferences/zotero.js
@@ -44,6 +44,7 @@ pref("extensions.zotero.viewOnDoubleClick", true);
pref("extensions.zotero.groups.copyChildLinks", true);
pref("extensions.zotero.groups.copyChildFileAttachments", true);
pref("extensions.zotero.groups.copyChildNotes", true);
+pref("extensions.zotero.groups.copyTags", true);
pref("extensions.zotero.backup.numBackups", 2);
pref("extensions.zotero.backup.interval", 1440);