Download button on reports page always downloads same file

Bug #1937982 reported by Phil Rankin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Unassigned
21.04
Fix Released
High
Unassigned

Bug Description

Description:
When generating a report in /admin/users/statistics.php, clicking the 'Download' button always downloads a file containing the exact same data as the first report that was run.

Steps to replicate:
1. Go to the Reports page and click Configure Report
2. Find a report that will generate some data e.g. 'Account details'. Select a date range and click Submit.
3. Click 'Download' at the bottom of the page - view the file and look at the contents, also note the total file size on your computer
4. Find a different report that will generate some data, find an appropriate date range and click Submit
5. Click 'Download' again and view the file

Observed results:
The second generated file has the exact same contents as the first one. It has the exact same filesize as the first also. Essentially the resulting file doesn't reflect the newly-run report in any way. It's as if the first file that is generated is held in cache and can't be overwritten by a new report.

Expected results:
The second generated file contains the results of the second report that was run

Additional notes:
This happens regardless of the date range and report type. You could select the same report and try generating two lots of results with different date ranges - the exact same file (the very first one) will still be downloaded.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Hi Phil,

Thank you for your report. We know the problem: one report download has the same name as one other. I don't think we have a patch public yet, so will add it as soon as we have it. It would be fantastic if you tried it out then.

Thank you
Kristina

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11875

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11875
Committed: https://git.mahara.org/mahara/mahara/commit/9ae952e327cb27bf813a1a0a1a941c04b0c020ff
Submitter: Gold (<email address hidden>)
Branch: master

commit 9ae952e327cb27bf813a1a0a1a941c04b0c020ff
Author: Robert Lyon <email address hidden>
Date: Tue Jul 27 08:47:59 2021 +1200

Bug 1937982: Making sure report downloads have unique names

Fixed a problem where two reports had the same name and also made a
change where the datestamp for the CSV file is added to the name in
case browsers are caching them and so fetching cached one instead of
newly generated one.

Change-Id: Id0f4ae007dbc96aab76842a7ffae7acbf391d6af
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "21.04_STABLE" branch: https://reviews.mahara.org/12008

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/12008
Committed: https://git.mahara.org/mahara/mahara/commit/599057eaff975a2481a5f272098324858d23c3e7
Submitter: Robert Lyon (<email address hidden>)
Branch: 21.04_STABLE

commit 599057eaff975a2481a5f272098324858d23c3e7
Author: Robert Lyon <email address hidden>
Date: Tue Jul 27 08:47:59 2021 +1200

Bug 1937982: Making sure report downloads have unique names

Fixed a problem where two reports had the same name and also made a
change where the datestamp for the CSV file is added to the name in
case browsers are caching them and so fetching cached one instead of
newly generated one.

Change-Id: Id0f4ae007dbc96aab76842a7ffae7acbf391d6af
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 9ae952e327cb27bf813a1a0a1a941c04b0c020ff)

no longer affects: mahara/21.10
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.