lochmueller / autoloader

⚙️ Best TYPO3 Swiss Army knife ever ⚙️
http://typo3.org/extensions/repository/view/autoloader
20 stars 30 forks source link

Typed property HDNET\Autoloader\Domain\Model\AbstractAdvancedRelation::$tablenames must not be accessed before initialization #164

Closed webian closed 3 years ago

webian commented 3 years ago

Hi! I'm trying to make a MN relation so I'm extending AbstractAdvancedRelation: class AnimalResults extends AbstractAdvancedRelation but I get errors like: Typed property HDNET\Autoloader\Domain\Model\AbstractAdvancedRelation::$tablenames must not be accessed before initialization To avoid this errors I have to declare $tablenames again in class AnimalResults and give it a default value:

    /**
     * Tablesnames.
     *
     * @DatabaseField(type="varchar", sql="varchar(60) DEFAULT '' NOT NULL")
     */
    protected string $tablenames = '';

Same for $sortingForeign and $ident.

I'm using PHP 7.4 and TYPO3 10 LTS.

Indeed it also works if I make these edits of the variables declarations directly in AbstractAdvancedRelation, at least in my installation.

Is it a bug or am I missing something?

webian commented 3 years ago

Sorry, I close this bug report to make a new one with more detail.