Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export_as_mla_citation_txt encounters a nilClass on production #3938

Open
regineheberlein opened this issue Jan 17, 2024 · 3 comments
Open

Comments

@regineheberlein
Copy link
Contributor

Expected behavior

A record can be exported in MLA format

Actual behavior

It serves the "Looks like something went wrong!" error page and reports
NoMethodError: undefined method `+' for nil:NilClass return temp_name.last + " " + temp_name.first

Steps to replicate

https://catalog.princeton.edu/catalog/99126151309006421/citation

Impact of this bug

Patrons cannot export citations in MLA format

Honeybadger link and code snippet, if applicable

Honeybadger report

NoMethodError: undefined method `+' for nil:NilClass return temp_name.last + " " + temp_name.first ^
    return name unless name =~ /,/
    temp_name = name.split(", ")
    return temp_name.last + " " + temp_name.first
  end
end```

### Implementation notes, if any

@sandbergja
Copy link
Member

I believe this happens because the record has a 700$a subfield with the content , . (comma space period).

The fix would likely be in this file in the blacklight-marc gem, with a test perhaps in this file

@sandbergja
Copy link
Member

This will be resolved upstream by projectblacklight/blacklight-marc#117

@sandbergja
Copy link
Member

The fix is now in blacklight-marc 8.1.2, we just need to upgrade and test to resolve this issue.

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

No branches or pull requests

2 participants