-
Notifications
You must be signed in to change notification settings - Fork 52
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
Support custom one to many relations in yaml fixtures by nesting entities
key
#619
Comments
nmaier95
added a commit
to nmaier95/testing-framework
that referenced
this issue
Sep 6, 2024
Summary: Implement support to model custom relations of one-to-many relations inside fixture yamls by adding a new config field inside `entitySettings` for each table called `parentRelationColumnName`. When set, the data-array structure passed to the core `DataHandler` receives the relations like expected. The field needs to be set on a child record with the name of the parent record column name of the relation as its value. Resolves Issue TYPO3#619
nmaier95
added a commit
to nmaier95/testing-framework
that referenced
this issue
Sep 6, 2024
Summary: Implement support to model custom relations of one-to-many relations inside fixture yamls by adding a new config field inside `entitySettings` for each table called `parentRelationColumnName`. When set, the data-array structure passed to the core `DataHandler` receives the relations like expected. The field needs to be set on a child record with the name of the parent record column name of the relation as its value. Resolves TYPO3#619
sbuerk
pushed a commit
to nmaier95/testing-framework
that referenced
this issue
Sep 29, 2024
Summary: Implement support to model custom relations of one-to-many relations inside fixture yamls by adding a new config field inside `entitySettings` for each table called `parentRelationColumnName`. When set, the data-array structure passed to the core `DataHandler` receives the relations like expected. The field needs to be set on a child record with the name of the parent record column name of the relation as its value. Resolves Issue TYPO3#619
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does your feature request relate to a problem?
Currently when writing yaml fixtures for test cases it is possible to model a datastructure by using the
entities
key. However the relation only correctly resolves when depending on the defaultpid
column (e.g. content elements inside pages, see "example 1").Example 1
Custom data structures with their own arbitrary relations cannot be modeled. Besides by creating them by their own and writing their incremented Uids (see
inline_record: 10000
at "example 2") by hand into the relation column which gets very messy when handling many.Example 2
Now lets assume one product may have many packageSizes (like also shown in "example 2"). And the TCA for the relation is configured as followed:
tx_extname_domain_model_productdetail
tx_extname_domain_model_packagesize
So each
packageSize
has theuid
of itsproductDetail
set in its columnproduct_detail
.Now to the root cause: The
TYPO3\CMS\Core\DataHandling\DataHandler
needs these kind of relations to be resolved by having the relation set the other way around. Meaning the datastructure theDataHandler
expects needs to be like this:Where the relation is set on the parent record and not like how it is stored in reality: on the child record.
Preferred Solution
Being able to configure those kind of relations by setting some sort of "parent relation column" in addition to the "pid" inside of the
entitySettings
of each fixture yaml.The text was updated successfully, but these errors were encountered: