Flash warning `Error: Record Not Found: Couldn't find Template without an ID` somewhere after visiting `/plans`
Please complete the following fields as applicable:
What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
3.1.1, but probably also 4.0.2 (see below)
Behaviour:
If you visit the page /plans, and then go any other page you'll see the yellow flash message Error: Record Not Found: Couldn't find Template without an ID.
I tracked it down to this line
which looks like an unsafe line. There is either a nil or a hash with funder_id and research_org_id present in params[:plan], but never a template_id. Anyway if it does, the check should be on params[:plan][:template_id] and not just on params[:plan]
Anyway, what is it used for? A single template lookup for a plan list looks a bit strange to me.
Agreed that the line looks strange. Thanks for investigating and finding the root of the issue @nicolasfranck. It looks like it is only used in conjunction with a modal window for creating a plan.
I vaguely remember a time when there was the ability to create a plan based off of one of the plans in the lower organizational template table. I'm not sure if this is a remnant of that functionality or not. I just double checked on my instance though and it is no longer in use.
This should be cleaned up at some point along with the unused erb partials and any corresponding JS that was used to open/close the modal dialog.