-
Notifications
You must be signed in to change notification settings - Fork 494
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
8600 duplicate template #8706
8600 duplicate template #8706
Conversation
@@ -46,6 +46,22 @@ public Template findByDeafultTemplateOwnerId(Long ownerId) { | |||
query.setParameter("ownerId", ownerId); | |||
return query.getSingleResult(); | |||
} | |||
|
|||
public List<Template> findByOwnerId(Long ownerId) { | |||
TypedQuery<Template> query = em.createQuery("select object(o) from Template as o where o.dataverse.id =:ownerId order by o.name", Template.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make these named queries?
return query.getResultList(); | ||
} | ||
|
||
public List<Template> findOrphan() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be removed, as with the other code?
|
||
https://github.com/IQSS/dataverse/raw/develop/scripts/issues/8600/delete_orphan_templates_8600.sh | ||
|
||
In order to support the script two admin APIs for finding and deleting templates have been added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
badly worded ("two" as in one for finding and one for deleting)
What this PR does / why we need it: Fixes logic in Copy template that was allowing templates with no dataverse ID to be created. Also adds admin APIs for finding and deleting templates and adds a script for deleting the orphan templates.
Which issue(s) this PR closes:
Closes #8600 Duplicate template seems to create db entries even when cancel.
Special notes for your reviewer: the fix in the cloneTemplate method was fairly simple. Handling the orphan templates added most of the changes
Suggestions on how to test this: the orphan templates are on the template table with Dataverse_id = null
Does this PR introduce a user interface change? If mockups are available, please link/include them here: no
Is there a release notes update needed for this change?: added
Additional documentation: