Project

General

Profile

Actions

Bug #91388

closed

Extending from the User Table

Added by C. Gogolin almost 4 years ago. Updated almost 4 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Start date:
2020-05-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
data model mapping
Complexity:
medium
Is Regression:
Sprint Focus:

Description

Hi,

I have built an extension for 9.5. This extends the fe_users table. (My model is simply called User)

The change #87623 (https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.0/Breaking-87623-ReplaceConfigpersistenceclassesTyposcriptConfiguration.html ) caused my TypoScript:

config.tx_extbase {
    persistence {
        classes {
            TYPO3\CMS\Extbase\Domain\Model\FrontendUser {
                subclasses {
                    Tx_Usertools_User = Cylancer\Usertools\Domain\Model\User
                }
            }
            Cylancer\Usertools\Domain\Model\User {
                mapping {
                    tableName = fe_users
                    recordType = 0
                }
            }

        }
    }
}

to move it to the PHP class:

<?php
declare(strict_types = 1);

return [
    \TYPO3\CMS\Extbase\Domain\Model\FrontendUser::class => [
        'subclasses' => 
             [ 'Tx_Usertools_User' => 'Cylancer\Usertools\Domain\Model\User' ]
       ],        
    \Cylancer\Usertools\Domain\Model\User::class => [
        'tablename' => 'fe_users',
        'recordType' => 0
    ]    
];

Now I have a repository for the user. This repository is derived from FrontendUserRepository.

If my controller
this->userRepository->findByUid(...) calls, I get an exception:

(1/3) #1472074485 TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException

Table 't3_demo.tx_usertools_domain_model_user' doesn't exist

Somehow the mapping doesn't seem to work properly anymore. Either I didn't understand the docu correctly or the mapping I defined doesn't seem to have gotten around in the logic everywhere.

How do you evaluate this?

As an example I have attached my extension.

Install it and try the frontend plugin "Edit profile" if you are logged in as frontend user.

Regards Clemens


Files

Actions #1

Updated by C. Gogolin almost 4 years ago

I have also tested other variants of the new mappings, all unsuccessful...

by example:

<?php
declare(strict_types = 1);
return [
    \Cylancer\Usertools\Domain\Model\User::class => [
        "tablename" => "fe_users" 
    ]
];

Actions #2

Updated by C. Gogolin almost 4 years ago

Embarrassingly embarrassing...

It's tableName, not tablename.

I'm sorry, I'm sorry.

Please close this issue...

Gretting Clemens

Actions #3

Updated by Georg Ringer almost 4 years ago

  • Status changed from New to Rejected
Actions

Also available in: Atom PDF