Get started with PHP-Fusion

Start a New Thread

Users Participated

  • Chan
    Post made: 1
  • Driv3r
    Post made: 1

  1. PHP-Fusion Support Forums
  2. Development & Design
  3. Downloads Issues (9)

Download update datestamp fix

Downloads Issues (9)

1 Reply 614 Views Last Updated on 9 months ago

Driv3r


Junior Member

#1

Posted 9 months ago

Hi!
I don't know if this was a know issue yet, but currently editing a download item will update the datestamp for it, no matter if it was checked or not in the admin.
But it's easy to fix (but took me some time to figure it out). In the admin/downloads.php file, around line 89 you can find this:
Code Gist: Download source  

'download_datestamp' => isset($_POST['update_datestamp']) ? time() : $data['download_datestamp']

Just simply edit the "$data" to "$_POST" and it's all solved:
Code Gist: Download source  

'download_datestamp' => isset($_POST['update_datestamp']) ? time() : $_POST['download_datestamp']

The reason for this that the $data['download_datestamp'] is empty here, because the database query happens later in the code. So because of that, the value stays the default given in the array (which is time()). And there is a hidden form already with the download_datestamp value, so that's it, no other modification needed. I guess it was just a typo, or something.
Edited by Driv3r on 07-07-2016 20:34

Posts: 29

Joined: 08/07/2012

Chan


Super Admin

#2

Posted 9 months ago

Hi Driv3r , thank you for taking time at the codes.

Can you submit a pull request to the 9.01 repo? This way, it's more time efficient. Only me reviewing the codes at the moment.

Posts: 3397

Joined: 25/09/2007

Jump to Forum:
11 users are online
0 member and 11 guests