Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating an item template from an existing item creates errors #2385

Closed
pronguen opened this issue Sep 15, 2021 · 0 comments · Fixed by #2444
Closed

Creating an item template from an existing item creates errors #2385

pronguen opened this issue Sep 15, 2021 · 0 comments · Fixed by #2444
Assignees
Labels
bug Breaks something but is not blocking f: professional ui Professional interface p-Medium Medium priority (to be solved within 1-2 years)
Milestone

Comments

@pronguen
Copy link
Contributor

pronguen commented Sep 15, 2021

Describe the bug

Creating an item template from an existing item creates errors: holdings/document/library/status are saved in the template but should not
* if the holdings, for ex, is deleted, the template is then broken
* if a status "on loan" is saved in the item, the item has this status but no loan linked to it

To Reproduce

Case 1: document link

  1. Look for an existing item
  2. Edit it
  3. Save it as a template
  4. Delete the item and its corresponding holdings
  5. Try to display and use the template

Case 2: status

  1. Look for an existing item
  2. Do a checkout
  3. Edit the item
  4. Save it as a template
  5. Create another item with this template
  6. See the wrong item status

Expected behavior

Fields holdings/document/library/status are not saved in the template. Check also for other fields, and other templates.

Context

@pronguen pronguen added bug Breaks something but is not blocking p-Medium Medium priority (to be solved within 1-2 years) labels Sep 15, 2021
BadrAly pushed a commit to BadrAly/rero-ils that referenced this issue Oct 6, 2021
Remove all fields from the template data dictionary that
can have links to other records or causes a problem for
the circulation module and integrity of data at the
creation of the templates.

* Closes rero#2385

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
BadrAly pushed a commit to BadrAly/rero-ils that referenced this issue Oct 6, 2021
Remove all fields from the template data dictionary that
can have links to other records or causes a problem for
the circulation module and integrity of data at the
creation of the templates.

* Closes rero#2385

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
BadrAly pushed a commit to BadrAly/rero-ils that referenced this issue Oct 6, 2021
Remove all fields from the template data dictionary that
can have links to other records or causes a problem for
the circulation module and integrity of data at the
creation of the templates.

* Closes rero#2385

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
BadrAly pushed a commit to BadrAly/rero-ils that referenced this issue Oct 7, 2021
Remove all fields from the template data dictionary that
can have links to other records or causes a problem for
the circulation module and integrity of data at the
creation of the templates.

* Closes rero#2385
* Fixes problem when librarian can be deleted even if they own templates

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
BadrAly pushed a commit to BadrAly/rero-ils that referenced this issue Oct 12, 2021
* Removes all fields from the template data dictionary that are links to
  other records or that causes issues with the circulation module and
  with data integrity at the creation of the templates.
* Closes rero#2385.
* Fixes problem when librarian can be deleted even if they own templates.

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
BadrAly pushed a commit to BadrAly/rero-ils that referenced this issue Oct 12, 2021
* Removes all fields from the template data dictionary that are links to
  other records or that causes issues with the circulation module and
  with data integrity at the creation of the templates.
* Closes rero#2385.
* Fixes problem when librarian can be deleted even if they own templates.

Use the following command to clean up the current templates saved in database:
The current templates will be backed-up in this file `templates.json`

```
poetry run tools.py tools migration clean_templates -o templates.json
```

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
BadrAly pushed a commit to BadrAly/rero-ils that referenced this issue Oct 13, 2021
* Removes all fields from the template data dictionary that are linked to
  other records or that causes issues with the circulation module and
  with data integrity at the creation of the templates.
* Closes rero#2385.
* Fixes problem when librarian can be deleted even if they own templates.

Use the following command to clean up the current templates saved in database:
The current templates will be backed-up in this file `templates.json`

```
poetry run tools.py tools migration clean_templates -o templates.json
```

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
BadrAly pushed a commit that referenced this issue Oct 13, 2021
* Removes all fields from the template data dictionary that are linked to
  other records or that causes issues with the circulation module and
  with data integrity at the creation of the templates.
* Closes #2385.
* Fixes problem when librarian can be deleted even if they own templates.

Use the following command to clean up the current templates saved in database:
The current templates will be backed-up in this file `templates.json`

```
poetry run tools.py tools migration clean_templates -o templates.json
```

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
@iGormilhit iGormilhit added the f: professional ui Professional interface label Oct 13, 2021
@iGormilhit iGormilhit added this to the v1.6.0 milestone Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks something but is not blocking f: professional ui Professional interface p-Medium Medium priority (to be solved within 1-2 years)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants