php - TYPO3: Save and edit the first & last name of an FE user
I created an extension with the extension builder which extends the FE user model.
To access the fields, I added the properties inside the extension builder accordingly. This worked great with
address etc. Unfortunately, you can't enter underscores, so I couldn't add
last_name to the properties. I added
lname (inside the ext. builder) instead and renamed every
last_name by hand (inside the code).
I hope you could follow me until now.
Because the problem is, when adding a FE user through the new action in the frontend, the first and last name won't be saved. But you can save them without a problem in the backend.
Any ideas how to fix that?
Use the extbase conventions for field names (lower camel case in model classes, e.g.
$lastName). If you do this, they will automatically mapped to the database fields
last_name, which is also the reason for the restriction in the
extension_builder. If you don't want to do this, you have to configure the mapping of field name to database field manually in your TypoScript configuration.
Alternatively, you can just use the properties and accessor methods provided by the extbase
FrontendUsermodel, from which you inherit - no need to implement that stuff yourself.