support DateTime objects in meta fields - #6096
Open
JoeJoeflyn wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6096 +/- ##
=========================================
Coverage 88.75% 88.76%
- Complexity 10090 10093 +3
=========================================
Files 889 889
Lines 32152 32155 +3
=========================================
+ Hits 28538 28542 +4
+ Misses 3614 3613 -1
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5833
Meta fields store values as TEXT strings. When a DateTime form type is used, saving a
DateTimeobject silently dropped the value, and reading it back crashed because the form transformer expected aDateTimeInterfacebut got a string.This adds DateTime handling to
MetaTableTypeTrait, mirroring how it already converts bool, int, and float:setValue()— formatsDateTimeInterfacetoY-m-d H:i:sbefore storinggetValue()— converts the stored string back to aDateTimeforDateTimePickerTypeandDatePickerTypeTests added to
AbstractMetaEntityTestCasecovering set/get round-trip and null, running across all 6 meta entity types.