roadmap
roadmap copied to clipboard
Download plan as csv records export twice
Please complete the following fields as applicable:
What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
3.1.1
Expected behaviour:
When I download my plan as csv, that should only be recorded once
Actual behaviour:
When I download my plan as csv, it is recorded twice
Possible cause:
- Plan#record_plan_export records every plan export
- Every call to Plan#prepare calls that
record_plan_export
-
PlanExportsController#show calls
Plan#as_pdf
which callsprepare
and so records plan export. Almost every export format uses the returned@hash
- the csv export is the only place where that
@hash
is NOT used. Plan#as_csv also callsprepare
so download is recorded twice.
Maybe call this method Plan#record_plan_export
more explicitly in the client code, in order to prevent this kind of issues?