Defect #44768
closed"Private by default" tracker setting overrides an explicitly specified public flag and the private flag of copied issues
Description
When "Private by default" (added in #9432) is enabled for a tracker, new issues on that tracker become private even when "public" is specified explicitly or the source issue of a copy is public.
Steps to reproduce¶
- In Administration > Trackers, enable "Private by default" for a tracker.
- Use an account that has the "Set issues public or private" permission.
- Create or copy an issue on that tracker in one of the following ways:
- Send an email with
Private: Noin the body. - Import a CSV file whose private column is
no. - Bulk copy public issues, leaving "Private" as "(No change)".
- Copy a public issue from the issue page.
- Send an email with
Actual behavior¶
- Email, CSV import, and bulk copy: the created issues are private.
- Copy: the "Private" checkbox is checked on the new issue form, although the source issue is public.
Expected behavior¶
The tracker setting should only be a default for issues where the private flag is not specified.
- An explicit
Private: Noin an email andnoin a CSV file should create a public issue. - Copying an issue (single or bulk with "(No change)") should keep the private flag of the source issue.
Creating an issue via the REST API without is_private still creates a private issue, which is the intended behavior.
Environment¶
- Redmine version: trunk r25469
Patch¶
I have attached three patches. Please apply them in order.
0001-fix-private-no-mail-keyword_r25469.patch: Makes thePrivate: Nokeyword in incoming emails work. It has been ignored since the keyword was added in #31324. With this patch, replying withPrivate: Noalso makes a private issue public, if the user is allowed to change the private flag.0002-keep-explicit-public-flag-with-private-by-default_r25469.patch: Keeps an explicitly specified public flag for incoming emails and CSV import.0003-keep-private-flag-when-copying-issues_r25469.patch: Keeps the private flag of the source issue when copying issues.
Files
Updated by Takenori TAKAKI 16 days ago
After re-reading #9432, I understand that "Private by default" is meant to prevent issues from being created as public by mistake. A copied issue is also a new issue on that tracker, so it should follow the setting too.
The current copy behavior is therefore correct, and I would like to withdraw 0003-keep-private-flag-when-copying-issues_r25469.patch. 0001 and 0002 can still be applied without it.
Updated by Go MAEDA 11 days ago
- Related to Feature #9432: Default value for the private issue flag added
Updated by Go MAEDA 11 days ago
- Status changed from New to Resolved
- Assignee set to Go MAEDA
- Target version set to 7.0.4
- Resolution set to Fixed
Committed the first two patches in r25480 and r25481. Thank you for reporting the problem and providing the patches.
I agree that 0003-keep-private-flag-when-copying-issues_r25469.patch should not be committed. Copying an issue is a feature that helps users create a new issue. Therefore, when users create an issue with a tracker that has "Private by default" enabled, they will expect the new issue to be private, even if the source issue is public. If the copied issue kept the private flag of the source issue, an issue that should be private could be created as public by mistake. This is the problem that "Private by default" is meant to prevent.
Users can still create a public copy if they want to. When copying a single issue, they can clear the "Private" checkbox on the new issue form. When copying multiple issues, they can select "No" for "Private".