Skip to content

Fix: restore publicationDate in dataset version api - #12957

Draft
ChengShi-1 wants to merge 1 commit into
developfrom
fix/dataset-version-publication-date-regression
Draft

ChengShi-1 wants to merge 1 commit into
developfrom
fix/dataset-version-publication-date-regression

Conversation

@ChengShi-1

@ChengShi-1 ChengShi-1 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
While checking some frontend E2E test failures, I traced to PR #12846 . The dataset-version API previously returned the full publication date in publicationDate and omitted the field for datasets that had never been published. After #12846, it can return a citation year even for a draft.

The frontend uses the presence of publicationDate to decide whether to fetch :latest-published. For draft-only datasets, that request returns 404.

Step Before 12846 After 12846
Fetch the draft GET /api/datasets/123/versions/:draft → 200 OK Same request → 200 OK
Draft response excerpt {"versionState":"DRAFT"} {"versionState":"DRAFT","publicationDate":"2026"}
Frontend behavior Renders the dataset as Draft and Unpublished. Sees publicationDate and requests GET /api/datasets/123/versions/:latest-published.
Result The draft page loads. The extra request returns 404, and the page shows Dataset not found.

I am not sure if this API behavior change was intentional, but after reading the issue description, I think it is more likely a side effact, and changing this in backend is easier. Let me know if you'd prefer I change the behavior in frontend

#12846 made publicationDate return the citation year, which is set even for never-published drafts. Clients treated that as a published version and requested :latest-published, getting a 404. Exports already override publicationDate in jsonAsDatasetDto, so the citation year moves to a separate citationYear field.
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:fix-dataset-version-publication-date-regression
ghcr.io/gdcc/configbaker:fix-dataset-version-publication-date-regression

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

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

API Test Results

424 tests  ±0   410 ✅ ±0   29m 55s ⏱️ - 3m 4s
 59 suites ±0    14 💤 ±0 
 59 files   ±0     0 ❌ ±0 

Results for commit 686bb47. ± Comparison against base commit 22947e4.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

JSF Test Results

54 files  +4  54 suites  +4   48m 30s ⏱️ +22s
22 tests ±0  19 ✅  - 1  2 💤 ±0  1 ❌ +1 
66 runs  +6  57 ✅ +4  8 💤 +1  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 686bb47. ± Comparison against base commit 22947e4.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 57.113% — fix/dataset-version-publication-date-regression into develop. No base build found for develop.

This branch has not been deployed

No deployments
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.

2 participants