Mass import: Undefined method `external_authors' for Hash when sending claim emails

Description

When performing a semi-automated import, claim notifications are sent to authors whose emails are valid. To minimise confusion, this is only done when importing to Beta, and at some point, this functionality was broken due to a hash key being treated like a method.

Steps to reproduce

  • Import a work through the API with send_emails: true

  • The import succeeds (the work is imported) but returns the error message:

Activity

Show:
Lady Oscar
June 30, 2019, 6:02 AM

What does this need, testing-wise?

Alison Watson
June 30, 2019, 9:09 AM

I imported two works to staging

A - to an address I have previously imported to, but have not claimed yet

B - to an email address i have previously imported to and claimed.

 

Results: Emails yay!

email A lists ALL unclaimed works i have ever imported

Email B lists ALL the works i have ever claimed

 

Email A is expected behaviour. \o/

I am not sure that email B is expected behaviour (ie i can’t remember if this happened before, i think not?). In any case I think it’s undesirable behaviour, as it may confuse people into thinking that we have imported a work for a second time (and what happens if you’ve since deleted one of those works?)

Alison Watson
July 13, 2019, 8:18 PM
Edited

Tested importing more works to email address B - the resulting email only included the newly imported works, as expecte. I think what might have happened in my earlier test is that claim emails weren’t sent during some previous import testing, so the archive said “Hey they haven’t been notified, I’ll tell them about those with these new works”. And today, since it’d already told me last month, it didn’t bother telling me again. (BTW this behaviour is likely nothing to do with the ticket’s fix, just something that occurred while testing it that I wanted to note. As far as we know the claim notification code is working as it always has.)

 

I’m declaring this issue resolved.

Lady Oscar
July 14, 2019, 4:39 AM

Looks good!

DeployedToBeta

Assignee

Ariana

Reporter

Ariana

Roadmap

Work Importing

Priority

Medium

Affects versions

Fix versions

Components

BackEnd

Difficulty

Medium

Required Access Level

Archivist

Milestone

Internal 0.9