Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing Custom Field property (like Readonly) not working with Powermail 8.x #7

Open
mfvetter opened this issue Jan 19, 2021 · 4 comments

Comments

@mfvetter
Copy link

Hello! Anyone having issues with TYPO3 10 + Powermail 8 trying to add a custom field (like the Readonly example option based on Powermailextended extension)?

I’m able to have the backdend working with my custom fields, it shows and saves properly on the backend. But I can’t access the new field property values in my Fluid templates. Even the Readonly example from Powermailextened isn’t working.

It was working ok on TYPO3 9.5.x + Powermail 7.x. Any clues are welcomed :)

@mfvetter
Copy link
Author

By the way, to avoid an error loading this extension on Typo3 10, I had to adjust line 6 of ext_tables.php to be 'powermailextened' instead of $_EXTKEY.

@Mainbird
Copy link

Hi @mfvetter,

you have to do some changes for TYPO3 10.

  1. Migrate config.tx_extbase.persistence (https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.0/Breaking-87623-ReplaceConfigpersistenceclassesTyposcriptConfiguration.html)

EXT:example/Configuration/Extbase/Persistence/Classes.php

<?php
declare(strict_types=1);

return [
    \In2code\Powermail\Domain\Model\Field::class => [
        'subclasses' => [
            0 => \Example\Extension\Domain\Model\PowermailField::class,
        ],
    ],
    \In2code\Powermail\Domain\Model\Page::class => [
        'subclasses' => [
            0 => \Example\Extension\Domain\Model\PowermailPage::class,
        ],
    ],
    \In2code\Powermail\Domain\Model\Form::class => [
        'subclasses' => [
            0 => \Example\Extension\Domain\Model\PowermailForm::class,
        ],
    ],
    \Example\Extension\Domain\Model\PowermailField::class => [
        'tableName' => 'tx_powermail_domain_model_field',
    ],
    \Example\Extension\Domain\Model\PowermailPage::class => [
        'tableName' => 'tx_powermail_domain_model_page',
    ],
    \Example\Extension\Domain\Model\PowermailForm::class => [
        'tableName' => 'tx_powermail_domain_model_form',
    ],
];
  1. Migrate config.tx_extbase.object (https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.5/Deprecation-86270-ExtbaseXclassViaTypoScriptSettings.html)

EXT:example/ext_localconf.php

<?php
defined('TYPO3_MODE') || die();

(static function() {
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\In2code\Powermail\Domain\Repository\FormRepository::class] = [
        'className' => \Example\Extension\Domain\Repository\PowermailFormRepository::class
    ];
})();

The rest should be the same. I hope this will help you. :)

@agendartobias
Copy link

agendartobias commented Feb 25, 2021

@Mainbird tnx for your solution, it works for me. I had to do this for Domain\Model\Mail.

Additional i had to define ballow code in ext_localconf.php so i was able to edit forms via. powermail frontend editing

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

@mfvetter
Copy link
Author

@Mainbird, thank you! It worked for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants