Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf195b8

Browse files
committed
bug EasyCorp#3827 Allow using virtual fields of type datetime (javiereguiluz)
This PR was merged into the 3.0.x-dev branch. Discussion ---------- Allow using virtual fields of type datetime Fixes EasyCorp#3821. Commits ------- 579b7d0 Allow using virtual fields of type datetime
2 parents 8efe133 + 579b7d0 commit bf195b8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Field/Configurator/DateTimeConfigurator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $c
8787

8888
$field->setFormattedValue($formattedValue);
8989

90+
// check if the property is immutable, but only if it's a real Doctrine entity property
91+
if (!$entityDto->hasProperty($field->getProperty())) {
92+
return;
93+
}
9094
$doctrineDataType = $entityDto->getPropertyMetadata($field->getProperty())->get('type');
9195
$isImmutableDateTime = \in_array($doctrineDataType, [Types::DATETIME_IMMUTABLE, Types::DATE_IMMUTABLE, Types::TIME_IMMUTABLE], true);
9296
if ($isImmutableDateTime) {

0 commit comments

Comments
 (0)