Loading core/includes/file.inc +6 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,12 @@ * configuration value will be, if clean-up not disabled, removed during cron * runs, but permanent files will not be removed during the file garbage * collection process. * * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use * \Drupal\file\FileInterface::STATUS_PERMANENT or * \Drupal\file\FileInterface::setPermanent() instead. * * @see https://www.drupal.org/node/3022147 */ const FILE_STATUS_PERMANENT = 1; Loading core/lib/Drupal/Core/Entity/entity.api.php +1 −1 Original line number Diff line number Diff line Loading @@ -567,7 +567,7 @@ * Here is an example, using the core File entity: * @code * $fids = Drupal::entityQuery('file') * ->condition('status', FILE_STATUS_PERMANENT, '<>') * ->condition('status', \Drupal\file\FileInterface::STATUS_PERMANENT, '<>') * ->condition('changed', REQUEST_TIME - $age, '<') * ->range(0, 100) * ->execute(); Loading core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -152,9 +152,9 @@ public function testImageFieldSync() { $field_values = [ 'uri' => $this->files[$index]->uri, 'uid' => \Drupal::currentUser()->id(), 'status' => FILE_STATUS_PERMANENT, ]; $file = File::create($field_values); $file->setPermanent(); $file->save(); $fid = $file->id(); $this->files[$index]->fid = $fid; Loading core/modules/editor/editor.module +1 −2 Original line number Diff line number Diff line Loading @@ -444,8 +444,7 @@ function editor_entity_revision_delete(EntityInterface $entity) { /** * Records file usage of files referenced by formatted text fields. * * Every referenced file that does not yet have the FILE_STATUS_PERMANENT state, * will be given that state. * Every referenced file that is temporally saved will be resaved as permanent. * * @param array $uuids * An array of file entity UUIDs. Loading core/modules/file/file.module +3 −3 Original line number Diff line number Diff line Loading @@ -560,8 +560,8 @@ function file_save_data($data, $destination = NULL, $replace = FileSystemInterfa $file = File::create([ 'uri' => $uri, 'uid' => $user->id(), 'status' => FILE_STATUS_PERMANENT, ]); $file->setPermanent(); // If we are replacing an existing file re-use its database record. // @todo Do not create a new entity in order to update it. See // https://www.drupal.org/node/2241865. Loading Loading @@ -709,7 +709,7 @@ function file_cron() { if ($age) { $fids = Drupal::entityQuery('file') ->accessCheck(FALSE) ->condition('status', FILE_STATUS_PERMANENT, '<>') ->condition('status', FileInterface::STATUS_PERMANENT, '<>') ->condition('changed', REQUEST_TIME - $age, '<') ->range(0, 100) ->execute(); Loading Loading @@ -1782,7 +1782,7 @@ function file_get_file_references(FileInterface $file, FieldDefinitionInterface function _views_file_status($choice = NULL) { $status = [ 0 => t('Temporary'), FILE_STATUS_PERMANENT => t('Permanent'), FileInterface::STATUS_PERMANENT => t('Permanent'), ]; if (isset($choice)) { Loading Loading
core/includes/file.inc +6 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,12 @@ * configuration value will be, if clean-up not disabled, removed during cron * runs, but permanent files will not be removed during the file garbage * collection process. * * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use * \Drupal\file\FileInterface::STATUS_PERMANENT or * \Drupal\file\FileInterface::setPermanent() instead. * * @see https://www.drupal.org/node/3022147 */ const FILE_STATUS_PERMANENT = 1; Loading
core/lib/Drupal/Core/Entity/entity.api.php +1 −1 Original line number Diff line number Diff line Loading @@ -567,7 +567,7 @@ * Here is an example, using the core File entity: * @code * $fids = Drupal::entityQuery('file') * ->condition('status', FILE_STATUS_PERMANENT, '<>') * ->condition('status', \Drupal\file\FileInterface::STATUS_PERMANENT, '<>') * ->condition('changed', REQUEST_TIME - $age, '<') * ->range(0, 100) * ->execute(); Loading
core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -152,9 +152,9 @@ public function testImageFieldSync() { $field_values = [ 'uri' => $this->files[$index]->uri, 'uid' => \Drupal::currentUser()->id(), 'status' => FILE_STATUS_PERMANENT, ]; $file = File::create($field_values); $file->setPermanent(); $file->save(); $fid = $file->id(); $this->files[$index]->fid = $fid; Loading
core/modules/editor/editor.module +1 −2 Original line number Diff line number Diff line Loading @@ -444,8 +444,7 @@ function editor_entity_revision_delete(EntityInterface $entity) { /** * Records file usage of files referenced by formatted text fields. * * Every referenced file that does not yet have the FILE_STATUS_PERMANENT state, * will be given that state. * Every referenced file that is temporally saved will be resaved as permanent. * * @param array $uuids * An array of file entity UUIDs. Loading
core/modules/file/file.module +3 −3 Original line number Diff line number Diff line Loading @@ -560,8 +560,8 @@ function file_save_data($data, $destination = NULL, $replace = FileSystemInterfa $file = File::create([ 'uri' => $uri, 'uid' => $user->id(), 'status' => FILE_STATUS_PERMANENT, ]); $file->setPermanent(); // If we are replacing an existing file re-use its database record. // @todo Do not create a new entity in order to update it. See // https://www.drupal.org/node/2241865. Loading Loading @@ -709,7 +709,7 @@ function file_cron() { if ($age) { $fids = Drupal::entityQuery('file') ->accessCheck(FALSE) ->condition('status', FILE_STATUS_PERMANENT, '<>') ->condition('status', FileInterface::STATUS_PERMANENT, '<>') ->condition('changed', REQUEST_TIME - $age, '<') ->range(0, 100) ->execute(); Loading Loading @@ -1782,7 +1782,7 @@ function file_get_file_references(FileInterface $file, FieldDefinitionInterface function _views_file_status($choice = NULL) { $status = [ 0 => t('Temporary'), FILE_STATUS_PERMANENT => t('Permanent'), FileInterface::STATUS_PERMANENT => t('Permanent'), ]; if (isset($choice)) { Loading