Issue Bug Rejected

#97472TYPO3 tries to persist value if model has predefined value even though TCA field type "none"

Alexander Grein 04/25/22, 18:46 updated 07/18/22, 13:05

Description

After refactoring a model class and adding a predefined value to a field which TCA type is set to “none”, TYPO3 tries to persist this predefined value to a none existing database field, which ends in an exception.

The (simplified) model:

<?php
class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
  protected float $distance = 0.0;

  public function setDistance(float $distance): void
  {
    $this->distance = $distance;
  }
  public function getDistance(): float
  {
    return $this->distance;
  }
}

The TCA field config:

'columns' => [
  'distance' => [
    'config' => [
      'type' => 'none',
    ],
  ],
]

I use this field to add a calculated distance to a location depending of the users location.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.