Skip to content

DCC bug 406 - Download plan with coversheet is broken.#3158

Merged
raycarrick-ed merged 2 commits into
developmentfrom
dcc_bug_703_Error_406_Admins_plan_page
Apr 14, 2022
Merged

DCC bug 406 - Download plan with coversheet is broken.#3158
raycarrick-ed merged 2 commits into
developmentfrom
dcc_bug_703_Error_406_Admins_plan_page

Conversation

@johnpinto1

Copy link
Copy Markdown
Contributor

DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/703

Problem is that in concerns/exportable_plan.rb the method prepare_coversheet_for_csv(csv, _headings, hash) assumes hash[:attribution] is an ActiveRecord::Relation when it is always a string with a single author created in prepare_coversheet() method.
Hence hash[:attribution].many? throws an error in
csv << [if hash[:attribution].many?.

Changes for fix:

  • in prepare_coversheet_for_csv(csv, headings, hash) added
    csv << [
    ('Creator:'), format(_('%{author}'), author: hash[:attribution])]
    instead and removed
    csv << [if hash[:attribution].many?...]

When one tried to download a plan as a csv file with coversheet one got an error.
Selection_041
Selection_040

DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/703

Problem is that in concerns/exportable_plan.rb the method  prepare_coversheet_for_csv(csv, _headings, hash) assumes  hash[:attribution] is an  ActiveRecord::Relation when it is always a string with a single author created in prepare_coversheet() method.
Hence hash[:attribution].many? throws an error in
   csv << [if hash[:attribution].many?.

Changes for fix:
- in prepare_coversheet_for_csv(csv, _headings, hash) added
   csv << [_('Creator:'), format(_('%{author}'), author: hash[:attribution])]
instead and removed
  csv << [if hash[:attribution].many?...]
@johnpinto1 johnpinto1 force-pushed the dcc_bug_703_Error_406_Admins_plan_page branch from d952149 to d1a073a Compare April 14, 2022 10:48
@raycarrick-ed raycarrick-ed merged commit 7a1707c into development Apr 14, 2022
@raycarrick-ed raycarrick-ed deleted the dcc_bug_703_Error_406_Admins_plan_page branch April 14, 2022 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants