Closed justinlittman closed 9 months ago
Exemplar:
This is a publication that belongs to author id # 170880:
pub = Publication.find(225274) Csl::Citation.new(pub.pub_hash).citations
/opt/app/pub/sul-pub/shared/bundle/ruby/3.2.0/gems/citeproc-1.0.10/lib/citeproc/date.rb:83:in `initialize': struct size differs (ArgumentError)
csl_doc = Csl::Mapper.new(pub.pub_hash).csl_doc CiteProc::Item.new(csl_doc.deep_dup) /opt/app/pub/sul-pub/shared/bundle/ruby/3.2.0/gems/citeproc-1.0.10/lib/citeproc/date.rb:83:in `initialize': struct size differs (ArgumentError) csl_doc.delete('event-date') CiteProc::Item.new(csl_doc.deep_dup) => #
The fact that the csl_doc has "event-date"=>"1997-06-02T00:00:00" seems to be a problem.
Problem seems to be here: https://github.com/sul-dlss/sul_pub/blob/main/lib/csl/mapper.rb#L78
In some specific cases, we are generating this in the csl-doc:
"event-date"=>"1997-06-02T00:00:00",
when we should be generating this:
"event-date"=>{"date-parts"=>[["1997-06-02T00:00:00"]]},
Problem seems to be here: https://github.com/sul-dlss/sul_pub/blob/main/lib/csl/mapper.rb#L78
See https://github.com/sul-dlss/sul_pub/blob/main/lib/csl/mapper.rb#L80-L83 for what it should be
Backtrace
View full backtrace and more info at honeybadger.io