Summary:
AWSS3 frontend actions call removed/renamed API methods, breaking uploads and the file listing
Detailed Description:
AWSS3 (installed 2.0.0). Two frontend actions call methods that no longer exist
in the current AWSS3 API, so both features fail on PHP 8.
1) action.dropzone_upload.php
Calls $AWSS3->sanitizeS3FileName($filename), which is not defined on the
module. The call returns nothing, so the sanitized filename is
empty and every upload aborts with "File name is required" (all file types,
not just zip). No file can be uploaded.
Fix: sanitize the filename in the action itself (keep the extension, replace
unsafe characters), and only use the module method if it
actually exists.
2) action.directory.php
Three problems on the listing path, each masking the next:
- Bucket is resolved via $this->GetOptionValue('bucket_name'), which is no
longer populated, so the action returns early and the file list
renders empty.
- $query->list() is called on bucket_query, but that class only exposes
execute(); list() does not exist.
- helpers::encodeS3URI() is called on the prefix, but that method does not
exist on the helpers class.
Result: the Documents/Files listing is always empty even when objects exist in
the bucket.
Fix: resolve the bucket from the action param, falling back to the module
default bucket (GetBucket()); use execute() and read its
'items'; drop the encodeS3URI() call and use the raw prefix.
Both actions are project-customized copies that were written against an
older/different AWSS3 API. Recommend re-checking these actions
whenever AWSS3 is upgraded.
Environment: AWSS3 2.0.0, CMSMS 2.2.x, PHP 8.x.