diff --git a/.idea/altmedia.iml b/.idea/altmedia.iml
index f9d23e9e..7069445f 100644
--- a/.idea/altmedia.iml
+++ b/.idea/altmedia.iml
@@ -29,194 +29,199 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -234,7 +239,6 @@
-
@@ -268,20 +272,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -329,20 +318,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 46ac110a..a4bad70c 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -4,4 +4,7 @@
+
+ true
+
\ No newline at end of file
diff --git a/app/models/bibliographic/host_bib.rb b/app/models/bibliographic/host_bib.rb
index 65c4d217..7abab17e 100644
--- a/app/models/bibliographic/host_bib.rb
+++ b/app/models/bibliographic/host_bib.rb
@@ -38,9 +38,11 @@ def linked_bib_subfields_to_process(host_bib, marc_record)
end
def subfields_from_774(marc_record)
- MARC::Spec.find('774', marc_record).map do |f|
- { 't' => f['t'] || '', 'w' => f['w'] } unless f['w'].empty?
+ subfields = MARC::Spec.find('774', marc_record).map do |f|
+ { 't' => f['t'] || '', 'w' => f['w'] } if f['w'].present?
end
+ subfields.delete(nil)
+ subfields
end
end
diff --git a/spec/models/host_bib_spec.rb b/spec/models/host_bib_spec.rb
index a334e95d..84d2bf38 100644
--- a/spec/models/host_bib_spec.rb
+++ b/spec/models/host_bib_spec.rb
@@ -19,8 +19,10 @@ def marc_stub
record.append(control_field)
data_field1 = MARC::DataField.new('774', '0', '1', ['t', 'Seconde partie du discours aux Welches '], %w[w 991083840969706532], %w[9 Exl])
data_field2 = MARC::DataField.new('774', '0', '1', ['t', 'Où va donc largent.'], %w[w 991083840969706532], %w[9 Exl])
+ data_field3 = MARC::DataField.new('774', '0', '1', ['t', 'Agriculture and Natural Resources publications'], %w[9 unrelated])
record.append(data_field1)
record.append(data_field2)
+ record.append(data_field3)
record
end