From e948f79c4c0eca9c930691b9eabbcd5fea611ba7 Mon Sep 17 00:00:00 2001
From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org>
Date: Tue, 7 Jan 2014 10:09:22 +0000
Subject: [PATCH] =?UTF-8?q?Issue=20#2074475=20by=20benjy,=20G=C3=A1bor=20H?=
 =?UTF-8?q?ojtsy:=20Rename=20{file=5Fmanaged}.timestamp=20to=20'changed'?=
 =?UTF-8?q?=20and=20add=20a=20created=20timestamp.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 core/modules/file/config/views.view.files.yml | 72 +++++++++++++++++--
 core/modules/file/file.api.php                |  4 +-
 core/modules/file/file.install                | 14 ++--
 core/modules/file/file.module                 | 21 ++++--
 core/modules/file/file.views.inc              | 21 +++++-
 .../file/lib/Drupal/file/Entity/File.php      | 23 ++++--
 .../file/lib/Drupal/file/FileInterface.php    |  7 ++
 .../lib/Drupal/file/FileStorageController.php |  4 +-
 .../Drupal/file/Plugin/views/wizard/File.php  |  2 +-
 .../file/lib/Drupal/file/Tests/DeleteTest.php |  2 +-
 .../file/Tests/FileFieldRevisionTest.php      |  4 +-
 .../lib/Drupal/file/Tests/FileListingTest.php |  3 +-
 .../Drupal/file/Tests/FileManagedTestBase.php |  3 +-
 .../file/Tests/FileTokenReplaceTest.php       |  6 +-
 .../file/lib/Drupal/file/Tests/SaveTest.php   |  6 +-
 .../file/lib/Drupal/file/Tests/UsageTest.php  |  4 +-
 .../Tests/Entity/EntityCrudHookTest.php       |  3 +-
 .../upgrade/drupal-7.language.database.php    |  6 +-
 .../drupal-7.user_picture.database.php        |  3 +-
 .../lib/Drupal/user/Tests/UserPictureTest.php |  2 +-
 core/modules/user/user.install                |  3 +-
 21 files changed, 170 insertions(+), 43 deletions(-)

diff --git a/core/modules/file/config/views.view.files.yml b/core/modules/file/config/views.view.files.yml
index c11c4728459c..8aaae34439f8 100644
--- a/core/modules/file/config/views.view.files.yml
+++ b/core/modules/file/config/views.view.files.yml
@@ -71,7 +71,8 @@ display:
             filemime: filemime
             filesize: filesize
             status: status
-            timestamp: timestamp
+            created: created
+            changed: changed
             count: count
           info:
             fid:
@@ -109,7 +110,14 @@ display:
               separator: ''
               empty_column: false
               responsive: priority-low
-            timestamp:
+            created:
+              sortable: true
+              default_sort_order: desc
+              align: ''
+              separator: ''
+              empty_column: false
+              responsive: ''
+            changed:
               sortable: true
               default_sort_order: desc
               align: ''
@@ -123,7 +131,7 @@ display:
               separator: ''
               empty_column: false
               responsive: priority-medium
-          default: timestamp
+          default: changed
           empty_table: true
       row:
         type: fields
@@ -340,10 +348,10 @@ display:
           empty_zero: false
           hide_alter_empty: true
           plugin_id: file_status
-        timestamp:
-          id: timestamp
+        created:
+          id: created
           table: file_managed
-          field: timestamp
+          field: created
           relationship: none
           group_type: group
           admin_label: ''
@@ -392,6 +400,58 @@ display:
           custom_date_format: ''
           timezone: ''
           plugin_id: date
+        changed:
+          id: changed
+          table: file_managed
+          field: changed
+          relationship: none
+          group_type: group
+          admin_label: ''
+          label: 'Changed date'
+          exclude: false
+          alter:
+            alter_text: false
+            text: ''
+            make_link: false
+            path: ''
+            absolute: false
+            external: false
+            replace_spaces: false
+            path_case: none
+            trim_whitespace: false
+            alt: ''
+            rel: ''
+            link_class: ''
+            prefix: ''
+            suffix: ''
+            target: ''
+            nl2br: false
+            max_length: ''
+            word_boundary: true
+            ellipsis: true
+            more_link: false
+            more_link_text: ''
+            more_link_path: ''
+            strip_tags: false
+            trim: false
+            preserve_tags: ''
+            html: false
+          element_type: ''
+          element_class: ''
+          element_label_type: ''
+          element_label_class: ''
+          element_label_colon: true
+          element_wrapper_type: ''
+          element_wrapper_class: ''
+          element_default_classes: true
+          empty: ''
+          hide_empty: false
+          empty_zero: false
+          hide_alter_empty: true
+          date_format: medium
+          custom_date_format: ''
+          timezone: ''
+          plugin_id: date
         count:
           id: count
           table: file_usage
diff --git a/core/modules/file/file.api.php b/core/modules/file/file.api.php
index 9ebbc95096f6..ebc32aca95c5 100644
--- a/core/modules/file/file.api.php
+++ b/core/modules/file/file.api.php
@@ -81,8 +81,8 @@ function hook_file_validate(Drupal\file\FileInterface $file) {
  *   The file entity that is about to be created or updated.
  */
 function hook_file_presave(Drupal\file\FileInterface $file) {
-  // Change the file timestamp to an hour prior.
-  $file->timestamp -= 3600;
+  // Change the owner of the file.
+  $file->uid->value = 1;
 }
 
 /**
diff --git a/core/modules/file/file.install b/core/modules/file/file.install
index c5ec889d9161..8fd5a37bc8c1 100644
--- a/core/modules/file/file.install
+++ b/core/modules/file/file.install
@@ -78,8 +78,15 @@ function file_schema() {
         'default' => 0,
         'size' => 'tiny',
       ),
-      'timestamp' => array(
-        'description' => 'UNIX timestamp for when the file was added.',
+      'created' => array(
+        'description' => 'UNIX timestamp for when the file added.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'changed' => array(
+        'description' => 'UNIX timestamp for when the file was last changed.',
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
@@ -89,7 +96,7 @@ function file_schema() {
     'indexes' => array(
       'uid' => array('uid'),
       'status' => array('status'),
-      'timestamp' => array('timestamp'),
+      'changed' => array('changed'),
     ),
     'unique keys' => array(
       'uuid' => array('uuid'),
@@ -320,4 +327,3 @@ function file_update_8004() {
   );
   db_change_field('file_managed', 'filesize', 'filesize', $spec);
 }
-
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 1c1318893dd2..892b214ef15e 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -1036,7 +1036,11 @@ function file_tokens($type, $tokens, array $data = array(), array $options = arr
           break;
 
         // These tokens are default variations on the chained tokens handled below.
-        case 'timestamp':
+        case 'created':
+          $replacements[$original] = format_date($file->getCreatedTime(), 'medium', '', NULL, $langcode);
+          break;
+
+        case 'changed':
           $replacements[$original] = format_date($file->getChangedTime(), 'medium', '', NULL, $langcode);
           break;
 
@@ -1047,7 +1051,11 @@ function file_tokens($type, $tokens, array $data = array(), array $options = arr
       }
     }
 
-    if ($date_tokens = $token_service->findWithPrefix($tokens, 'timestamp')) {
+    if ($date_tokens = $token_service->findWithPrefix($tokens, 'created')) {
+      $replacements += $token_service->generate('date', $date_tokens, array('date' => $file->getCreatedTime()), $options);
+    }
+
+    if ($date_tokens = $token_service->findWithPrefix($tokens, 'changed')) {
       $replacements += $token_service->generate('date', $date_tokens, array('date' => $file->getChangedTime()), $options);
     }
 
@@ -1094,8 +1102,13 @@ function file_token_info() {
     'name' => t("URL"),
     'description' => t("The web-accessible URL for the file."),
   );
-  $file['timestamp'] = array(
-    'name' => t("Timestamp"),
+  $file['created'] = array(
+    'name' => t("Created"),
+    'description' => t("The date the file created."),
+    'type' => 'date',
+  );
+  $file['changed'] = array(
+    'name' => t("Changed"),
     'description' => t("The date the file was most recently changed."),
     'type' => 'date',
   );
diff --git a/core/modules/file/file.views.inc b/core/modules/file/file.views.inc
index f78ec87a2ec8..4e51a871efad 100644
--- a/core/modules/file/file.views.inc
+++ b/core/modules/file/file.views.inc
@@ -154,15 +154,30 @@ function file_views_data() {
     ),
   );
 
-  // timestamp field
-  $data['file_managed']['timestamp'] = array(
+  // The created field.
+  $data['file_managed']['created'] = array(
     'title' => t('Upload date'),
     'help' => t('The date the file was uploaded.'),
     'field' => array(
       'id' => 'date',
     ),
     'sort' => array(
-      'id' => 'date'
+      'id' => 'date',
+    ),
+    'filter' => array(
+      'id' => 'date',
+    ),
+  );
+
+  // The changed field.
+  $data['file_managed']['changed'] = array(
+    'title' => t('Modified date'),
+    'help' => t('The date the file was last changed.'),
+    'field' => array(
+      'id' => 'date',
+    ),
+    'sort' => array(
+      'id' => 'date',
     ),
     'filter' => array(
       'id' => 'date',
diff --git a/core/modules/file/lib/Drupal/file/Entity/File.php b/core/modules/file/lib/Drupal/file/Entity/File.php
index a88207eea0fd..816435b67107 100644
--- a/core/modules/file/lib/Drupal/file/Entity/File.php
+++ b/core/modules/file/lib/Drupal/file/Entity/File.php
@@ -108,11 +108,18 @@ public function setSize($size) {
     $this->get('filesize')->value = $size;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getCreatedTime() {
+    return $this->get('created')->value;
+  }
+
   /**
    * {@inheritdoc}
    */
   public function getChangedTime() {
-    return $this->get('timestamp')->value;
+    return $this->get('changed')->value;
   }
 
   /**
@@ -178,7 +185,11 @@ public static function preCreate(EntityStorageControllerInterface $storage_contr
   public function preSave(EntityStorageControllerInterface $storage_controller) {
     parent::preSave($storage_controller);
 
-    $this->timestamp = REQUEST_TIME;
+    $this->changed->value = REQUEST_TIME;
+    if (empty($this->created->value)) {
+      $this->created->value = REQUEST_TIME;
+    }
+
     $this->setSize(filesize($this->getFileUri()));
     if (!isset($this->langcode->value)) {
       // Default the file's language code to none, because files are language
@@ -253,9 +264,13 @@ public static function baseFieldDefinitions($entity_type) {
       ->setLabel(t('Status'))
       ->setDescription(t('The status of the file, temporary (0) and permanent (1).'));
 
-    $fields['timestamp'] = FieldDefinition::create('integer')
+    $fields['created'] = FieldDefinition::create('integer')
       ->setLabel(t('Created'))
-      ->setDescription(t('The time that the node was created.'));
+      ->setDescription(t('The timestamp that the file was created.'));
+
+    $fields['changed'] = FieldDefinition::create('integer')
+      ->setLabel(t('Changed'))
+      ->setDescription(t('The timestamp that the file was last changed.'));
 
     return $fields;
   }
diff --git a/core/modules/file/lib/Drupal/file/FileInterface.php b/core/modules/file/lib/Drupal/file/FileInterface.php
index 73783efcacfa..c4fd9f0f3cdf 100644
--- a/core/modules/file/lib/Drupal/file/FileInterface.php
+++ b/core/modules/file/lib/Drupal/file/FileInterface.php
@@ -127,4 +127,11 @@ public function getOwner();
    */
   public function setOwner(UserInterface $user);
 
+  /**
+   * Returns the node creation timestamp.
+   *
+   * @return int
+   *   Creation timestamp of the node.
+   */
+  public function getCreatedTime();
 }
diff --git a/core/modules/file/lib/Drupal/file/FileStorageController.php b/core/modules/file/lib/Drupal/file/FileStorageController.php
index 15cf03662768..1c0a3f133fb5 100644
--- a/core/modules/file/lib/Drupal/file/FileStorageController.php
+++ b/core/modules/file/lib/Drupal/file/FileStorageController.php
@@ -33,9 +33,9 @@ public function spaceUsed($uid = NULL, $status = FILE_STATUS_PERMANENT) {
   public function retrieveTemporaryFiles() {
     // Use separate placeholders for the status to avoid a bug in some versions
     // of PHP. See http://drupal.org/node/352956.
-    return $this->database->query('SELECT fid FROM {' . $this->entityInfo->getBaseTable() . '} WHERE status <> :permanent AND timestamp < :timestamp', array(
+    return $this->database->query('SELECT fid FROM {' . $this->entityInfo->getBaseTable() . '} WHERE status <> :permanent AND changed < :changed', array(
       ':permanent' => FILE_STATUS_PERMANENT,
-      ':timestamp' => REQUEST_TIME - DRUPAL_MAXIMUM_TEMP_FILE_AGE
+      ':changed' => REQUEST_TIME - DRUPAL_MAXIMUM_TEMP_FILE_AGE
     ));
   }
 }
diff --git a/core/modules/file/lib/Drupal/file/Plugin/views/wizard/File.php b/core/modules/file/lib/Drupal/file/Plugin/views/wizard/File.php
index 6cdf557dc330..00fb296eeb08 100644
--- a/core/modules/file/lib/Drupal/file/Plugin/views/wizard/File.php
+++ b/core/modules/file/lib/Drupal/file/Plugin/views/wizard/File.php
@@ -23,7 +23,7 @@ class File extends WizardPluginBase {
   /**
    * Set the created column.
    */
-  protected $createdColumn = 'timestamp';
+  protected $createdColumn = 'created';
 
   /**
    * Set default values for the path field options.
diff --git a/core/modules/file/lib/Drupal/file/Tests/DeleteTest.php b/core/modules/file/lib/Drupal/file/Tests/DeleteTest.php
index c6486fee910b..9d1911b79287 100644
--- a/core/modules/file/lib/Drupal/file/Tests/DeleteTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/DeleteTest.php
@@ -65,7 +65,7 @@ function testInUse() {
     // of the file is older than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
     db_update('file_managed')
       ->fields(array(
-        'timestamp' => REQUEST_TIME - (DRUPAL_MAXIMUM_TEMP_FILE_AGE + 1),
+        'changed' => REQUEST_TIME - (DRUPAL_MAXIMUM_TEMP_FILE_AGE + 1),
       ))
       ->condition('fid', $file->id())
       ->execute();
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php
index d54e596316cb..84bfd343f4ab 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldRevisionTest.php
@@ -119,7 +119,7 @@ function testRevisions() {
     // of the file is older than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
     db_update('file_managed')
       ->fields(array(
-        'timestamp' => REQUEST_TIME - (DRUPAL_MAXIMUM_TEMP_FILE_AGE + 1),
+        'changed' => REQUEST_TIME - (DRUPAL_MAXIMUM_TEMP_FILE_AGE + 1),
       ))
       ->condition('fid', $node_file_r3->id())
       ->execute();
@@ -134,7 +134,7 @@ function testRevisions() {
     // of the file is older than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
     db_update('file_managed')
       ->fields(array(
-        'timestamp' => REQUEST_TIME - (DRUPAL_MAXIMUM_TEMP_FILE_AGE + 1),
+        'changed' => REQUEST_TIME - (DRUPAL_MAXIMUM_TEMP_FILE_AGE + 1),
       ))
       ->condition('fid', $node_file_r1->id())
       ->execute();
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php b/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php
index 5582ce358ad9..dd274846383a 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileListingTest.php
@@ -158,7 +158,8 @@ protected function createFile() {
       'filename' => 'druplicon.txt',
       'uri' => 'public://druplicon.txt',
       'filemime' => 'text/plain',
-      'timestamp' => 1,
+      'created' => 1,
+      'changed' => 1,
       'status' => FILE_STATUS_PERMANENT,
     ));
     file_put_contents($file->getFileUri(), 'hello world');
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
index b6fb820fd1f1..85ee55358eb0 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
@@ -111,7 +111,8 @@ function createFile($filepath = NULL, $contents = NULL, $scheme = NULL) {
     $file->filename = drupal_basename($file->uri);
     $file->filemime = 'text/plain';
     $file->uid = 1;
-    $file->timestamp = REQUEST_TIME;
+    $file->created = REQUEST_TIME;
+    $file->changed = REQUEST_TIME;
     $file->filesize = filesize($file->uri);
     $file->status = 0;
     // Write the record directly rather than using the API so we don't invoke
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
index 924c2b903dee..9e0039dc5dd0 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
@@ -53,8 +53,10 @@ function testFileTokenReplacement() {
     $tests['[file:mime]'] = check_plain($file->getMimeType());
     $tests['[file:size]'] = format_size($file->getSize());
     $tests['[file:url]'] = check_plain(file_create_url($file->getFileUri()));
-    $tests['[file:timestamp]'] = format_date($file->getChangedTime(), 'medium', '', NULL, $language_interface->id);
-    $tests['[file:timestamp:short]'] = format_date($file->getChangedTime(), 'short', '', NULL, $language_interface->id);
+    $tests['[file:created]'] = format_date($file->getCreatedTime(), 'medium', '', NULL, $language_interface->id);
+    $tests['[file:created:short]'] = format_date($file->getCreatedTime(), 'short', '', NULL, $language_interface->id);
+    $tests['[file:changed]'] = format_date($file->getChangedTime(), 'medium', '', NULL, $language_interface->id);
+    $tests['[file:changed:short]'] = format_date($file->getChangedTime(), 'short', '', NULL, $language_interface->id);
     $tests['[file:owner]'] = check_plain(user_format_name($this->admin_user));
     $tests['[file:owner:uid]'] = $file->getOwner()->id();
 
diff --git a/core/modules/file/lib/Drupal/file/Tests/SaveTest.php b/core/modules/file/lib/Drupal/file/Tests/SaveTest.php
index 476110561b90..4c3b0c0f69ee 100644
--- a/core/modules/file/lib/Drupal/file/Tests/SaveTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/SaveTest.php
@@ -28,7 +28,8 @@ function testFileSave() {
       'filename' => 'druplicon.txt',
       'uri' => 'public://druplicon.txt',
       'filemime' => 'text/plain',
-      'timestamp' => 1,
+      'created' => 1,
+      'changed' => 1,
       'status' => FILE_STATUS_PERMANENT,
     ));
     file_put_contents($file->getFileUri(), 'hello world');
@@ -70,7 +71,8 @@ function testFileSave() {
       'filename' => 'DRUPLICON.txt',
       'uri' => 'public://DRUPLICON.txt',
       'filemime' => 'text/plain',
-      'timestamp' => 1,
+      'created' => 1,
+      'changed' => 1,
       'status' => FILE_STATUS_PERMANENT,
     ));
     file_put_contents($file->getFileUri(), 'hello world');
diff --git a/core/modules/file/lib/Drupal/file/Tests/UsageTest.php b/core/modules/file/lib/Drupal/file/Tests/UsageTest.php
index c4b053c65dad..5ce7937ab3e5 100644
--- a/core/modules/file/lib/Drupal/file/Tests/UsageTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/UsageTest.php
@@ -134,7 +134,7 @@ function testTempFileCleanup() {
     db_update('file_managed')
       ->fields(array(
         'status' => 0,
-        'timestamp' => 1,
+        'changed' => 1,
       ))
       ->condition('fid', $temp_old->id())
       ->execute();
@@ -151,7 +151,7 @@ function testTempFileCleanup() {
     // Permanent file that is older than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
     $perm_old = file_save_data('');
     db_update('file_managed')
-      ->fields(array('timestamp' => 1))
+      ->fields(array('changed' => 1))
       ->condition('fid', $temp_old->id())
       ->execute();
     $this->assertTrue(file_exists($perm_old->getFileUri()), 'Old permanent file was created correctly.');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCrudHookTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCrudHookTest.php
index e7cf67465307..784b0acee5dd 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCrudHookTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCrudHookTest.php
@@ -224,7 +224,8 @@ public function testFileHooks() {
       'filemime' => 'text/plain',
       'filesize' => filesize($url),
       'status' => 1,
-      'timestamp' => REQUEST_TIME,
+      'created' => REQUEST_TIME,
+      'changed' => REQUEST_TIME,
     ));
 
     $this->assertHookMessageOrder(array(
diff --git a/core/modules/system/tests/upgrade/drupal-7.language.database.php b/core/modules/system/tests/upgrade/drupal-7.language.database.php
index ab8a81622ff6..80253546b259 100644
--- a/core/modules/system/tests/upgrade/drupal-7.language.database.php
+++ b/core/modules/system/tests/upgrade/drupal-7.language.database.php
@@ -776,7 +776,8 @@
   'filemime',
   'filesize',
   'status',
-  'timestamp'
+  'created',
+  'changed',
 ))
 ->values(array(
   'fid' => '1',
@@ -786,6 +787,7 @@
   'filemime' => 'text/plain',
   'filesize' => 0,
   'status' => 1,
-  'timestamp' => '1314997642',
+  'created' => '1314997642',
+  'changed' => '1314997642',
 ))
 ->execute();
diff --git a/core/modules/system/tests/upgrade/drupal-7.user_picture.database.php b/core/modules/system/tests/upgrade/drupal-7.user_picture.database.php
index 12d2b2e6a830..54ea2d850dbf 100644
--- a/core/modules/system/tests/upgrade/drupal-7.user_picture.database.php
+++ b/core/modules/system/tests/upgrade/drupal-7.user_picture.database.php
@@ -19,7 +19,8 @@
     'filename' => 'faked_image.png',
     'filesize' => 1000,
     'filemime' => 'image/png',
-    'timestamp' => 1353542634,
+    'created' => 1353542634,
+    'changed' => 1353542634,
   ))
   ->execute();
 
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
index fa88502161d8..6363a91e822b 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserPictureTest.php
@@ -69,7 +69,7 @@ function testCreateDeletePicture() {
     // of the file is older than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
     db_update('file_managed')
       ->fields(array(
-        'timestamp' => REQUEST_TIME - (DRUPAL_MAXIMUM_TEMP_FILE_AGE + 1),
+        'changed' => REQUEST_TIME - (DRUPAL_MAXIMUM_TEMP_FILE_AGE + 1),
       ))
       ->condition('fid', $file->id())
       ->execute();
diff --git a/core/modules/user/user.install b/core/modules/user/user.install
index a194b00762aa..4d7393558abb 100644
--- a/core/modules/user/user.install
+++ b/core/modules/user/user.install
@@ -555,7 +555,8 @@ function user_update_8011() {
         'langcode' => Language::LANGCODE_NOT_SPECIFIED,
         'filesize' => filesize($destination),
         'filemime' => file_get_mimetype($destination),
-        'timestamp' => REQUEST_TIME,
+        'created' => REQUEST_TIME,
+        'changed' => REQUEST_TIME,
       ))
       ->execute();
     $default_image_fid = db_query('SELECT fid FROM {file_managed} WHERE uri = :uri', array(':uri' => $destination))->fetchField();
-- 
GitLab