Undefined array key "#upload_validators" in Drupal\s3fs_cors\Plugin\Field\FieldWidget\S3fsCorsFileWidget->formElement()

Created on 5 December 2024, 4 months ago

Problem/Motivation

The updated code does check the value of #upload_validators before this property is added by the parent::formElement() causing PHP warnings:

Warning: Undefined array key "#upload_validators" in Drupal\s3fs_cors\Plugin\Field\FieldWidget\S3fsCorsFileWidget->formElement() (line 106 of modules/contrib/s3fs_cors/src/Plugin/Field/FieldWidget/S3fsCorsFileWidget.php).
Warning: Trying to access array offset on value of type null in Drupal\s3fs_cors\Plugin\Field\FieldWidget\S3fsCorsFileWidget->formElement() (line 106 of modules/contrib/s3fs_cors/src/Plugin/Field/FieldWidget/S3fsCorsFileWidget.php).
Warning: Trying to access array offset on value of type null in Drupal\s3fs_cors\Plugin\Field\FieldWidget\S3fsCorsFileWidget->formElement() (line 106 of modules/contrib/s3fs_cors/src/Plugin/Field/FieldWidget/S3fsCorsFileWidget.php).
Deprecated function: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\Component\Utility\Bytes::toNumber() (line 76 of core/lib/Drupal/Component/Utility/Bytes.php).
Deprecated function: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\Component\Utility\Bytes::toNumber() (line 78 of core/lib/Drupal/Component/Utility/Bytes.php).

Steps to reproduce

Open the field widget

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine Taran2L Lviv

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024