Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of time fields in Feed Me data mapping/import missing #1561

Open
jamesmacwhite opened this issue Dec 9, 2024 · 0 comments
Open
Labels

Comments

@jamesmacwhite
Copy link
Contributor

jamesmacwhite commented Dec 9, 2024

Description

The time field does not appear to have proper field handling for feed mapping/importing. It is not listed in the fields list under src/fields.

Before in Craft CMS 3, you could create a date field but only display time only. Where as in Craft CMS 5, you can no longer do this and I assume encouraged to create a time field instead. Even under Craft CMS 3 an information tooltip suggests time field may be better suited.

The problem I have under Craft CMS 5 is when trying to import a date/time value to a time field, it isn't working reliably. While I can create a date field, I can't hide the date part on in the CMS backend which is potentially confusing for users

Example values that aren't being imported:

 "start_time": "01-01-1900 13:00:00",
 "end_time": "01-01-1900 15:30:00",

The field mapping also provides a plain text field as a default value, which seems odd, I'd imagine this should be a time field.

Image

It looks like the time field itself is not handled properly or falling back to generic field mapping template.

If I manipulate the value to just "13:00" and "15:30" Feed Me does import this. However I feel Feed Me is lacking any proper support for the Time field generally and given it is a core field, this should be addressed if possible. My assumption is because the time field is not specifically handled, the generic field default processing and template gets used and handles the values as strings, not date/time.

Steps to reproduce

  1. Create a time field
  2. Create a Feed Me import using an entry with a time field
  3. Attempt to populate a value like "01-01-1900 15:30:00"
  4. The import will discard the data and not import it.

Additional info

  • Craft version: 5.5.5
  • PHP version: 8.3
  • Database driver & version: MySQL
  • Plugins & versions: N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant