Open georgringer opened 5 years ago
Sure, go for it
Hi,
We need an updated documentation to add new fields. I lost two days to have something functional (extension femanagerextended). I found informations on stackoverflow and github, but even so, the data was not persisted in the database by the frontend (backend was ok). The problem was in the file ext_table where we add the fields in the TCA. So, I put the content of ext_table.php in /Configuration/TCA/Overrides/fe_users.php and now it works. I attach a zip with the test extension that works for me with femanager 5.1.1 and typo3 8.7 (php 7).
Regards
This is a simple working example from one of our customers. TYPO3 CMS 8.7.27 LTS, PHP 7.2.22-1+ubuntu18.04.1+deb.sury.org+1 and femanager 5.1.1 + extender 6.6.0:
ext_localconf.php
:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['femanager']['extender'][\In2code\Femanager\Domain\Model\User::class][$_EXTKEY]
= 'EXT:' . $_EXTKEY . '/Classes/Domain/Model/User.php';
/Classes/Domain/Model/User.php
:
<?php
namespace Vendor\ExtName\Domain\Model;
use In2code\Femanager\Domain\Model\User as ManagerUser;
class User extends ManagerUser
{
/**
* @var bool
*/
protected $agreedTerms;
public function getAgreedTerms()
{
return $this->agreedTerms;
}
public function setAgreedTerms($agreedTerms)
{
$this->agreedTerms = $agreedTerms;
}
/**
* @var string
*/
protected $department;
public function getDepartment()
{
return $this->department;
}
public function setDepartment($department)
{
$this->department = $department;
}
}
I propose a new version of how to extend the extension by using the EXT:extender which solves the problem with PHP7.2. if you are ok with it I would add a PR and new demo ext?