Replacing media image file fails when not opting to "Overwrite original file".

Created on 12 April 2023, about 2 years ago
Updated 6 May 2023, almost 2 years ago

Problem/Motivation

After replacing a file (media image) with the option "Overwrite original file" deselected, the following occurs:

  • The thumbnail fails to generate (its path appears as /sites/default/files/styles/thumbnail/public/media-icons/generic/no-thumbnail.png).
  • When editing the same item again, the "Replace File" section of the form is missing.
  • The file is uploaded to its appropriate location on S3.
  • The file's thumbnail is not generated at its appropriate location on S3.

Steps to reproduce

  1. Add new media image. (At this point, image and image style are both successfully uploaded to S3.)
  2. Edit image. (At this point, all looks normal. See screenshot 's3-image-original'.)
  3. Select replacement file, deselect option "Overwrite original file", and then click Save. (At this point, the image is uploaded to its appropriate S3 location but the thumbnail fails to generate.)
  4. Edit image again. (At this point, the "Replace File" section of the form is missing. See screenshot 's3-image-replaced'.)

Additional notes:

  • Replacing an image with the option "Overwrite original file" enabled does work as expected.
  • I am not using S3 to take over public:// or private://.
  • drush s3fs-refresh-cache and drush image-flush --all don't have any effect on the issue.
// s3fs.settings.yml

credentials_file: 'private://aws-credentials'
bucket: my-bucket
region: us-east-1
use_cname: false
domain_root: none
use_customhost: false
hostname: ''
domain: ''
use_path_style_endpoint: false
disable_version_sync: false
cache_control_header: ''
encryption: AES256
use_https: false
ignore_cache: false
read_only: false
disable_cert_verify: false
redirect_styles_ttl: 0
root_folder: path/to/root/folder
public_folder: ''
private_folder: ''
presigned_urls: ''
saveas: ''
torrents: ''
use_cssjs_host: false
cssjs_host: ''
use_credentials_cache: false
credentials_cache_dir: ''
keymodule:
  secret_key_name: ''
  access_key_name: ''
disable_shared_config_files: false
πŸ› Bug report
Status

Closed: cannot reproduce

Version

3.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @c. s. comfort
  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    The field in question does not appear to be a part of Drupal Core, without information what modules are involved (including Core version) this can't proceed.

    The file is uploaded to its appropriate location on S3.

    This would imply that at least a large portion of s3fs is functioning properly.

    The thumbnail fails to generate (its path appears as /sites/default/files/styles/thumbnail/public/media-icons/generic/no-thumbnail.png).

    This is value is used a default placeholder in core, this seems to imply a form issue, or an issue before rendering the form.

    Replacing an image with the option "Overwrite original file" enabled does work as expected.

    In the previous paragraph you mention Overwrite does not work, can you clarify which is the correct scenario?

    Are there any additional log entries from Drupal that could provide more context?

  • Status changed to Closed: cannot reproduce almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    With over 2 weeks of no additional information. I’m closing this out as cannot reproduce.

    if this issue still exists it may be reopened by providing the requested information.

Production build 0.71.5 2024