Skip to content

IBX-11818: added fallback to null value when key 'timestamp' not exists in $value->data array#757

Open
papcio122 wants to merge 7 commits into
5.0from
IBX-11818_empty_ibexa_datetime-field-causing-error
Open

IBX-11818: added fallback to null value when key 'timestamp' not exists in $value->data array#757
papcio122 wants to merge 7 commits into
5.0from
IBX-11818_empty_ibexa_datetime-field-causing-error

Conversation

@papcio122

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-11818

Description:

\Ibexa\Core\Persistence\Legacy\Content\FieldValue\Converter\DateAndTimeConverter:toStorageValue()
throws an error of a missing array key when the content was created before the field was added to the content type.
Added fallback to null when the data array has no 'timestamp' key

@papcio122 papcio122 marked this pull request as draft May 29, 2026 08:06
@papcio122 papcio122 marked this pull request as ready for review June 3, 2026 08:14
@papcio122 papcio122 added Bug Something isn't working Ready for review labels Jun 3, 2026
@papcio122 papcio122 requested a review from a team June 3, 2026 08:15
Comment thread src/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeConverter.php Outdated
@papcio122 papcio122 force-pushed the IBX-11818_empty_ibexa_datetime-field-causing-error branch from 22e8d03 to f08a3f5 Compare June 9, 2026 07:37
@papcio122 papcio122 requested a review from konradoboza June 9, 2026 08:17
* @group fieldType
* @group dateTime
*/
public function testToStorageValueNoTimestampKey(): void

@konradoboza konradoboza Jun 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also test if dataInt is properly populated with the timestamp if it exists.

@papcio122 papcio122 Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I referred to the actual usage of timestamp key which is in the condition in question. How is it covered?

Comment thread src/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeConverter.php Outdated
Comment thread tests/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeTest.php Outdated
Comment thread tests/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeTest.php Outdated
@papcio122 papcio122 force-pushed the IBX-11818_empty_ibexa_datetime-field-causing-error branch from b96fb48 to b95c1c6 Compare June 9, 2026 14:30

@bnowak bnowak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved assuming that failing CI will be fixed and left comments resolved

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants