Project

General

Profile

Actions

Bug #97472

closed

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

Added by Alexander Grein about 2 years ago. Updated almost 2 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-04-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Files

Screenshot_20220531_152802.png (12.7 KB) Screenshot_20220531_152802.png Sascha Löffler, 2022-05-31 13:32
Actions

Also available in: Atom PDF