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

Customized template not appearing as customized in Templates tab #1345

Closed
briri opened this issue Apr 4, 2018 · 7 comments
Closed

Customized template not appearing as customized in Templates tab #1345

briri opened this issue Apr 4, 2018 · 7 comments
Assignees
Labels
bug effort-medium 1/2 to 1 day of dev time templates

Comments

@briri
Copy link
Contributor

briri commented Apr 4, 2018

Please complete the following fields as applicable:

Expected behaviour: Customizing a template results in 'Unpublished changes' in the 'Customized table' tab

Actual behaviour: After customizing an existing template the 'Customized table' tab still shows 'Not customized'. It is working though for new templates

Steps to reproduce: Customize an existing template in DMPOnline and then go back to the Admin -> Templates page and view the row on the 'Customizable templates' table.

Issue appears to be coming from this method:

def self.org_customizations(dmptemplate_ids, org_id)

Which is called by this filter (included on the paginable/templates_controller.rb):

def apply_scoping(scope, customizable = false, all = false)

@briri briri added bug templates effort-medium 1/2 to 1 day of dev time labels Apr 4, 2018
@briri briri assigned briri and unassigned briri Apr 4, 2018
@briri
Copy link
Contributor Author

briri commented Apr 4, 2018

@jollopre and @vyruss you will need to look into this one since we cannot replicate it with our DMPTool data. I've highlighted the code that populates the 'Customizable Templates' table. The issue could also be happening on the template clone as well though since its grabbing data from the original template and this does not happen if the templates are new.

@jollopre jollopre self-assigned this Apr 6, 2018
@jollopre
Copy link
Contributor

jollopre commented Apr 6, 2018

@briri, @vyruss The source of the problem originates at Template.customization_of_with_max_version since it is grabbing the max version for each template whose customization_of is a dmptemplate_id of another template (e.g. funder for this case). This generic query can bring a template for another org if the version is higher but would be filtered down later on by Template.latest_customization.

I believe we can also replicate this on your data if you do the following:

  1. Customize a funder template with an org X
  2. Change org X to org Y
  3. Customize the same funder template with org Y
  4. Create different versions for that customized funder template with org Y
  5. Change to org X again and your customization is no longer accessible through the Customized templates tab

The PR #1351 should fix the problem, but anyway please test it from your side too.

@stephaniesimms
Copy link

working as expected now on roadmap stage. closing issue.

@sjDCC
Copy link
Contributor

sjDCC commented Apr 16, 2018

I've found a bug on this. Re-opening but perhaps it should be a new ticket?

Multiple unis can add annotations but when one does, it displays the warning that the funder template has been updated to others... It hasn't thought. It's just another uni doing a customisation.

bug

I added example answers to the Sloan template for UCSD and American Uni

@sjDCC sjDCC reopened this Apr 16, 2018
@briri
Copy link
Contributor Author

briri commented Apr 16, 2018

Hmm. Lets move this back to in Progress then so that we remember to recheck it. I think the changes @jollopre have been making to the templates code may address this issue.
If multiple Unis customize a funder template it should create individual template versions for them so that adding things like annotations or new sections to one customized template should not affect this status message of related customized templates. Only changes to the base funder template should cause this status message to change.

@stephaniesimms
Copy link

consensus to wait for template versioning work to be completed. this is related issue and may be fixed afterward. transfer customizations workflow is also a separate issue.

@sjDCC
Copy link
Contributor

sjDCC commented Apr 17, 2018

Ok, since this is a separate issue and will be handled later I have created a new ticket. It's #1390

@sjDCC sjDCC closed this as completed Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug effort-medium 1/2 to 1 day of dev time templates
Projects
None yet
Development

No branches or pull requests

4 participants