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

Trailing comma in author name causes error #10776

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

erodde
Copy link
Contributor

@erodde erodde commented Aug 15, 2024

What this PR does / why we need it:
Fixes a bug where a trailing comma in an author name leads to an error. Error occured to us in production recently, version 6.2.

Which issue(s) this PR closes:

Suggestions on how to test this:
See unit test or reproduce error by adding author name with trailing comma to dataset. Once dataset is published, error occurs on reload.

Is there a release notes update needed for this change?:
I added one just to be sure.

Copy link
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thanks!

@qqmyers qqmyers added the Size: 0.5 A percentage of a sprint. 0.35 hours label Aug 15, 2024
@coveralls
Copy link

coveralls commented Aug 15, 2024

Coverage Status

coverage: 20.791% (-0.01%) from 20.804%
when pulling 91377ba on erodde:10343_author_name_trailing_comma
into 53f9b45 on IQSS:develop.

@@ -89,6 +89,7 @@ public void testName() {
verifyIsPerson("kcjim11, kcjim11", "kcjim11", "kcjim11");

verifyIsPerson("Bartholomew 3, James", "James", "Bartholomew 3");
verifyIsPerson("Smith, ", null, "Smith");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if there is no space at the end? Should you add that as another test case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verifying failed because the compared JsonObject was normalized via an util method. I added the normalization to the comparison in the assertion and added the other test case.

@poikilotherm
Copy link
Contributor

/push-image to allow for QA testing, thx

@poikilotherm poikilotherm self-assigned this Sep 30, 2024
Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:10343-author-name-trailing-comma
ghcr.io/gdcc/configbaker:10343-author-name-trailing-comma

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

Copy link
Contributor

@poikilotherm poikilotherm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By applying this fix, I can add a name Schmidt, and it doesn't break JSON-LD anymore when I hit "publish".

grafik

I also used Schmidt, Test, as an example, stays unaffected. API output looks good, too. I verified that Schmidt, leads to an Error 500 page on gdcc/dataverse:unstable. Schmidt, Test, was never affected.

@poikilotherm poikilotherm merged commit 79365ad into IQSS:develop Sep 30, 2024
11 checks passed
@cmbz cmbz added the FY25 Sprint 7 FY25 Sprint 7 (2024-09-25 - 2024-10-09) label Sep 30, 2024
@pdurbin pdurbin added this to the 6.4 milestone Sep 30, 2024
@ofahimIQSS ofahimIQSS self-requested a review September 30, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 7 FY25 Sprint 7 (2024-09-25 - 2024-10-09) Size: 0.5 A percentage of a sprint. 0.35 hours
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

Trailing comma in the author name causes json-ld failure, kills the dataset page
8 participants