-
Notifications
You must be signed in to change notification settings - Fork 479
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
Iqss/7349 1 truncate description #9085
Iqss/7349 1 truncate description #9085
Conversation
Nominally schema.org requires description to be text (not an array as we had) and Google requires a description <5000 chars.
IQSS/8840-Improve_guestbook_estimate
Prio meeting with Stefano.
|
IQSS/7349-1_truncate_description
Got an error when publishing 6k in 6, 1k descript:
[descripTruncErr.txt](https://github.com/IQSS/dataverse/files/10539523/descripTruncErr.txt)
Dataset did publish but schema.org export was blank. When tried 1, 6k description, it worked in the UI but schema.org export still blank and a single warning was posted to server.log: |
What this PR does / why we need it: Per issue #7349, Google rejects descriptions in the schema.org page metadata. Further, it expects description to be a string rather than a JsonArray which we were sending. This PR joins descriptions with a linefeed and then truncates the result to <5000 characters, sending the description up to the last word boundary before 4997 characters and appending a '...' to indicate there's more content.
Which issue(s) this PR closes:
Closes #7349
Special notes for your reviewer: This is one of ~3 PRs to close the issue
Suggestions on how to test this: Just verify the unit tests run. Can confirm manually by adding a long description and verifying it is truncated as described above (and that shorter ones aren't, and that two descriptions that total more than 5K chars are truncated together, etc.). That said, the unit tests do verify that two descriptions are joined, and there's a separate test for truncation.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?: included
Additional documentation: