einpraegsam / powermailextended

Example extension how to extend powermail for TYPO3
8 stars 8 forks source link

Update for TYPO3 10? #8

Open deflektor-de opened 3 years ago

deflektor-de commented 3 years ago

Hi there,

although there have been some useful tips under "issues", I'm not able to add some custom fields to powermail anymore. I think there are too many changes with Object Storage and Powermail classes.

It would be really great, if any powermail insider could update the example extension for use with T3 10 or 11.

Thanks anyway, Chris

hahrens commented 3 years ago

Hi Chris, i've found your question while i'm searching for a solution to the same problem and want to share my solution here :)

You have to do two things.

  1. Add a Configuration\Extbase\Persistence\Classes.php (as described here in the official typo3v10-changelog and here you could find this file for/in the news extension)
  2. Add a mapper-line to your ext_localconf.php (typo3-v9.5-deprecation here)

Configuration/Extbase/Persistence/Classes.php:

<?php
return [
    \In2code\Powermail\Domain\Model\Field::class => [
        'subclasses' => [
            YOUR_MODEL_HERE::class,
        ]
    ],
    YOUR_MODEL_HERE::class => [
        'tableName' => 'tx_powermail_domain_model_field',
    ],
];

ext_localconf.php

\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class)
              ->registerImplementation(\In2code\Powermail\Domain\Model\Field::class, YOUR_MODEL_HERE::class);

Hope that helps :)