# Bug OP-15151 - Shared work packages in template projects cause several flaws in new projects

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-15151

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 14.3.0 |
| Observed in versions | 14.1.0 |
| Sprint | 14.3.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 14.1.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Attila Dombi |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Login as a user with permissions to create template projects, new projects from templates and to share work packages

2.  Create a new project and add a work package (e.g. "sharing test")

3.  share this work package with a user who is not a member of this project yet (permission to edit or read does not matter)

4.  save this project as a template

5.  Create a new project from the template you just saved

### What is the buggy behavior?

**Template project:**

  - The number of shares of a work package will add a +1 each time the template is used
    
    <img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/105478/content">

**New project created from template:**

The newly created work package which has been shared in the template project, does not indicate that it has been shared.

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/105479/content">

Since this is a newly created work package, it is true that this particular work package has not been shared yet. However, that newly created project has a member (auto selected while creating a new project from template) who originates from the shared work package in the template project.  
The member list of the new project indicates a shared work package with this member:

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/105481/content">

That link is dead though and delivers a blank page

### What is the expected behavior?

I am not sure what the intended workflow is in this case. But the current state seems inconsistent and should at least

1.  not add up (+1) the number of shares in the template project each time a template is used

2.  not provide a dead link in a newly created project

A user who only had access to certain work packages in a template project should maybe only have access to these work packages again if both (user and work packages) have been copied while using the template project.

### 

### Screenshots and other files

*see above*

### Environment information

*Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs*

**OpenProject installation type**

- [x] Hosted cloud edition

- [ ] Packaged installation
  
    - What distribution?

- [ ] Docker All-in-one container

- [ ] Docker-compose installation

- [ ] Other (please specify)

**OpenProject version**

*If you're not running on the cloud edition, please specify the version of OpenProject you're running. Example: v12.1.5*

**Browser**

- [ ] Chrome
- [x] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Language**

*DE/EN tested*

*mentioned in support ticket 15559*
