Skip to content

NPE for preview of draft file with retention period#12434

Open
jo-pol wants to merge 1 commit into
IQSS:developfrom
DANS-KNAW-jp:retention-npe
Open

NPE for preview of draft file with retention period#12434
jo-pol wants to merge 1 commit into
IQSS:developfrom
DANS-KNAW-jp:retention-npe

Conversation

@jo-pol
Copy link
Copy Markdown
Contributor

@jo-pol jo-pol commented Jun 4, 2026

What this PR does / why we need it:

Which issue(s) this PR closes:

Special notes for your reviewer:

The change was suggested by copilot, it fixes the reported problem but I'm pretty clueless.

Suggestions on how to test this:

See issue

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?:

Additional documentation:

#{bundle['file.metadataTab.fileMetadata.publicationDate.label']}
</th>
<td>#{(empty FilePage.file.embargo) and !(empty FilePage.file.released) and !(empty FilePage.file.retention) ? ''.concat(FilePage.file.publicationDateFormattedYYYYMMDD).concat('; ') : ''}
<td>#{(empty FilePage.file.embargo) and FilePage.file.released and !(empty FilePage.file.retention) ? FilePage.file.publicationDateFormattedYYYYMMDD : ''}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the root cause is not addressed by this fix, although I can see why it would work. Since FilePage.file.released is a boolean !(empty FilePage.file.released) is always true (false is not empty). So the first branch with the concats runs when the publication date is null. I think if you replace that with FilePage.file.released it should work without needing to split adding the ; into a separate step. (Unless we have a bug where the released is true and the pub date is still null. If so, testing if the pub date is null might be a better choice.)

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Triage

Development

Successfully merging this pull request may close these issues.

Preview of draft file with retention period causes internal server error

3 participants