Fix column/property types in CalDAV#30438
Merged
ChristophWurst merged 3 commits intomasterfrom Apr 1, 2022
Merged
Conversation
Member
Author
|
/backport to stable23 |
Member
Author
|
/backport to stable22 |
This was referenced Dec 29, 2021
tcitworld
reviewed
Dec 29, 2021
tcitworld
approved these changes
Dec 29, 2021
| foreach ($this->propertyMap as $xmlName => [$dbName, $type]) { | ||
| $value = $row[$dbName]; | ||
| if ($value !== null) { | ||
| settype($value, $type); |
Member
There was a problem hiding this comment.
Should we handle settype returning false? Throw/log something?
Member
Author
There was a problem hiding this comment.
We also don't handle it in \OCP\AppFramework\Db\Entity::setter, so I'm not sure
miaulalala
approved these changes
Jan 3, 2022
Contributor
miaulalala
left a comment
There was a problem hiding this comment.
LGTM, I created and deleted calendar events and calendar recurrences.
StatAna isn't happy.
eea8d01 to
2b4c91e
Compare
Contributor
|
Drone failure unrelated. |
Merged
2b4c91e to
a7ad376
Compare
Member
|
/rebase |
The timestamp is an int, but we treated it as string. With this patch the property map is enriched with types and settype casts the value if necessary. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
a7ad376 to
288f07a
Compare
Merged
This was referenced Apr 1, 2022
Merged
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.
The timestamp and the calendar order are int, but we treated them as string. With this patch
the property map is enriched with types and settype casts the value if necessary.
Ideally we migrate this DB access code to something like a QBMapper. Then these things will be taken care of for us automagically. But that is for another day.
Discovered in #30437