in2code-de / femanager

Modern TYPO3 Frontend User RegistrationTYPO3 Frontend User Registration and Management based on Extbase and Fluid and on TYPO3 8 and the possibility to extend it to your needs. Extension basicly works like sr_feuser_register
https://www.in2code.de/agentur/typo3-extensions/femanager/
48 stars 118 forks source link

Example how to add new fields #126

Open georgringer opened 5 years ago

georgringer commented 5 years ago

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?

einpraegsam commented 5 years ago

Sure, go for it

etnicoliver commented 5 years ago

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

femanagerextended.zip

DanielSiepmann commented 4 years ago

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;
    }
}