Closed briri closed 6 years ago
@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.
@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:
The PR #1351 should fix the problem, but anyway please test it from your side too.
working as expected now on roadmap stage. closing issue.
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.
I added example answers to the Sloan template for UCSD and American Uni
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.
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.
Ok, since this is a separate issue and will be handled later I have created a new ticket. It's #1390
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: https://github.com/DMPRoadmap/roadmap/blob/67edbda193ff2ad7412c972c12bd927b2ad72094/app/models/template.rb#L130
Which is called by this filter (included on the
paginable/templates_controller.rb
): https://github.com/DMPRoadmap/roadmap/blob/67edbda193ff2ad7412c972c12bd927b2ad72094/lib/template_filter.rb#L3