Bug #3837
Objects added to a repository are not found if repository doesn't follow naming conventions
Status: | Resolved | Start date: | 2009-07-07 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Karsten Dambekalns | % Done: | 100% |
|
Category: | Persistence | |||
Target version: | TYPO3 Flow Base Distribution - 1.0 alpha 3 | |||
PHP Version: | Complexity: | |||
Has patch: | Affected Flow version: |
Description
We have a model called \F3\TYPO3\Domain\Model\Structure\Site and a repository called \F3\TYPO3\Domain\Repository\SiteRepository.
Note that the repository doesn't follow the naming conventions – it should rather be called \F3\TYPO3\Domain\Repository\Structure\SiteRepository.
If a Site object is added to the (first) repository, it will be sucessfully stored in the CR. However, executing findAll() on the repository won't return any object because the repository's createQuery() method assumes the correct (second) repository name. This is a good thing but should also be enforced while adding objects.
Solution:
Define the model class name during construction / initialization of the repository and use that name everywhere in the repository functions to check objects passed to the repository against it.
Associated revisions
[+BUGFIX] FLOW3 (Persistence): when handing objects over to a Repository instance their type is now checked against the type managed by the Repository instance, fixes #3837.
[~BUGFIX] FLOW3 (Persistence): when handing objects over to a Repository instance their type is now checked against the type managed by the Repository instance, fixes #3837.
[~BUGFIX] FLOW3 (Persistence): Fixed two tests I overlooked, relates to #3837.
History
#1 Updated by Robert Lemke about 6 years ago
- Assigned To set to Karsten Dambekalns
#2 Updated by Karsten Dambekalns about 6 years ago
- Status changed from New to Accepted
#3 Updated by Karsten Dambekalns about 6 years ago
- Status changed from Accepted to Resolved
- % Done changed from 0 to 100
Applied in changeset r2877.