What steps does it take to reproduce the issue? Wile testing #12421, two related issues were discovered w.r.t. the default/suggested date when setting a retention period. First, when intially launched the retention dialog shows a date one day after the minimum allowed date, e.g. Nov 19 instead of 18 (which is allowed) in:
Second, if the dialog is closed and reopened, the default changes to 1000 years in the future:
Due to
dataverse/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Line 2307 in 0b87f4b
selectionRetention.setDateUnavailable(minRetentiondate.plusDays(1L));
and
dataverse/src/main/java/edu/harvard/iq/dataverse/FilePage.java
Line 296 in 0b87f4b
selectionRetention.setDateUnavailable(minRetentiondate.plusDays(1L));
, the initial choice for retention period is the day after the minimum - seems like plusDays(1) isn't needed if the minimum now has a minusDays(1).
If I cancel the retention dialog and reopen it, the default date shown is 1000 years in the future. I think that's due to creation of a new Retention at
dataverse/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Line 6849 in 0b87f4b
selectionRetention= new Retention();
(which defaults to 1000 years in the constructor), without code like this
dataverse/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Lines 2305 to 2308 in 0b87f4b
LocalDate minRetentiondate = settingsWrapper.getMinRetentionDate();
if (minRetentiondate != null){
selectionRetention.setDateUnavailable(minRetentiondate.plusDays(1L));
}
which is done at page init but not in the clearRetentionPopup method. (Similar issue with the FilePage.)
As these are all retention date related and relatively simple, would you like to fix them in this PR, or do you want to treat them as a separate issue/possible PR for the future?
Which version of Dataverse are you using?
6.11+ / develop
Any related open or closed issues to this bug report?
Screenshots:
No matter the issue, screenshots are always welcome.
To add a screenshot, please use one of the following formats and/or methods described here:
Are you thinking about creating a pull request for this issue?
Help is always welcome, is this bug something you or your organization plan to fix?
Just capturing the issue at present.
What steps does it take to reproduce the issue? Wile testing #12421, two related issues were discovered w.r.t. the default/suggested date when setting a retention period. First, when intially launched the retention dialog shows a date one day after the minimum allowed date, e.g. Nov 19 instead of 18 (which is allowed) in:
Second, if the dialog is closed and reopened, the default changes to 1000 years in the future:
When does this issue occur?
Editing the retention period.
Which page(s) does it occurs on?
Dataset and file pages.
Why does it happen?
Due to
dataverse/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Line 2307 in 0b87f4b
selectionRetention.setDateUnavailable(minRetentiondate.plusDays(1L));
and
dataverse/src/main/java/edu/harvard/iq/dataverse/FilePage.java
Line 296 in 0b87f4b
selectionRetention.setDateUnavailable(minRetentiondate.plusDays(1L));
, the initial choice for retention period is the day after the minimum - seems like plusDays(1) isn't needed if the minimum now has a minusDays(1).
If I cancel the retention dialog and reopen it, the default date shown is 1000 years in the future. I think that's due to creation of a new Retention at
dataverse/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Line 6849 in 0b87f4b
selectionRetention= new Retention();
(which defaults to 1000 years in the constructor), without code like this
dataverse/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Lines 2305 to 2308 in 0b87f4b
LocalDate minRetentiondate = settingsWrapper.getMinRetentionDate();
if (minRetentiondate != null){
selectionRetention.setDateUnavailable(minRetentiondate.plusDays(1L));
}
which is done at page init but not in the clearRetentionPopup method. (Similar issue with the FilePage.)
As these are all retention date related and relatively simple, would you like to fix them in this PR, or do you want to treat them as a separate issue/possible PR for the future?
Which version of Dataverse are you using?
6.11+ / develop
Any related open or closed issues to this bug report?
Screenshots:
No matter the issue, screenshots are always welcome.
To add a screenshot, please use one of the following formats and/or methods described here:
Are you thinking about creating a pull request for this issue?
Help is always welcome, is this bug something you or your organization plan to fix?
Just capturing the issue at present.