Skip to content

Commit

Permalink
proper check for publisher name & id
Browse files Browse the repository at this point in the history
  • Loading branch information
tomek1024 committed Dec 13, 2016
1 parent 3ca4648 commit 416c0eb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/elibri_onix_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -587,14 +587,16 @@ def export_publisher_info!(product)
end
end

if product.respond_to?(:publisher_name) && product.publisher_name
if product.respond_to?(:publisher_name_for_onix) && product.publisher_name_for_onix
tag(:Publisher) do
comment "Wydawca - używamy tylko kodu 01 (główny wydawca)", :kind => :onix_publisher_info
tag(:PublishingRole, '01') # Publisher, lista 45 #TODO jeszcze może być współwydawca
tag(:PublisherIdentifier) do
tag(:PublisherIDType, '01') #prioprietary
tag(:IDTypeName, 'ElibriPublisherCode')
tag(:IDValue, product.publisher_id_for_onix)
if product.respond_to?(:publisher_id_for_onix)
tag(:PublisherIdentifier) do
tag(:PublisherIDType, '01') #prioprietary
tag(:IDTypeName, 'ElibriPublisherCode')
tag(:IDValue, product.publisher_id_for_onix)
end
end
tag(:PublisherName, product.publisher_name_for_onix)
end
Expand Down

0 comments on commit 416c0eb

Please sign in to comment.