Skip to content

fix: handle null formatting in date parsing#1656

Open
aedan-umd wants to merge 1 commit intocraftcms:6.xfrom
aedan-umd:bugfix/null-check-parse-date-attr
Open

fix: handle null formatting in date parsing#1656
aedan-umd wants to merge 1 commit intocraftcms:6.xfrom
aedan-umd:bugfix/null-check-parse-date-attr

Conversation

@aedan-umd
Copy link
Copy Markdown

Description

Fixes #1655

When calling craft\feedme\services\Process->processFeed() from CLI using JSON data exported by Craft's export button, the $formatting parameter can be null when not specified in $fieldInfo. This causes a TypeError in DateHelper::parseString().

Changes

  • Added null check in parseDateAttribute() to default to 'auto' formatting
  • Prevents TypeError when processing exported JSON data without explicit date formatting

Testing

  • Tested with exported JSON data via CLI
  • Confirmed existing functionality remains intact

- Default to 'auto' formatting when  parameter is null
- Prevents TypeError in DateHelper::parseString()
@aedan-umd aedan-umd requested a review from angrybrad as a code owner July 25, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DateHelper::parseString() receives null formatting parameter when processing exported JSON data

1 participant