Referenced Paragraph including a required date is being validated when a content type image upload is attempted

Created on 3 October 2024, 3 months ago

Problem/Motivation

The following error appears in the drupal log when trying to upload an image file within a content type where the same content type has a referenced paragraph which includes a required date field.

TypeError: DateTime::createFromFormat(): Argument #2 ($datetime) must be of type string, array given in DateTime::createFromFormat() (line 251 of /var/www/stormsriver-adventures/web/core/lib/Drupal/Component/Datetime/DateTimePlus.php).

All image field uploads will not work on the content editing page, i.e. standard content type 'image field' and paragraph 'image fields' when the paragraph date field is set to 'required'.

Steps to reproduce

Add content from a content type which includes a paragraph with a required date field.

  1. Go to Add Content
  2. Upload image in image field
  3. Error Message block appears asking to look at log (log message above)

Proposed resolution

Ensure that any referenced paragraph content is not 'validated' or prevent whichever process is causing the date field (or any other field) within the paragraph to be interacted with when any other content type fields are being worked on, i.e. a standard image field upload.

Temporary Solution (not a solve)

Disable 'required' setting on paragraph date field. Although this can be done it means some required fields may not be captured which is an issue.

Remaining tasks

Not certain

User interface changes

Not certain

API changes

Not certain

Data model changes

Not certain

πŸ› Bug report
Status

Active

Version

1.18

Component

Code

Created by

πŸ‡ΏπŸ‡¦South Africa markpape Durban

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

Comments & Activities

Production build 0.71.5 2024