Skip to content
Snippets Groups Projects
Commit 0bdafea7 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[BUGFIX] Ignore deleted records while fetching an attribute by url_name

parent e5c25879
No related branches found
No related tags found
No related merge requests found
......@@ -173,4 +173,13 @@ Here is list of commands that are useful for development of Symfony projects.
`mysqldump -t -u userName -ppassword dbName tableName` - dumps mySql for backup. Useful to see mySql statements which represent current database state.
`phpunit -c app src/CompanyManagementBundle/Tests/Entity/RoleRepositoryFunctionalTest.php` - runns phpunit tests
\ No newline at end of file
`phpunit -c app src/CompanyManagementBundle/Tests/Entity/RoleRepositoryFunctionalTest.php` - runns phpunit tests
### 5. Notes
Please note that nothing is really deleted. Currently just a deleted flag is set to prevent data loss. It's not possible to
readd a new type that was already and deleted. Showing deleted elements is a missing feature for logged in users right now
and must be added later to circumvent this problem.
Another problem is that right now duplicate type names in different typo3 groups can't be differed, because the information
is missing in the url. This may be added later on if the feature is really used.
......@@ -302,6 +302,7 @@ class Attribute {
// I know... would be better to split the table into type and attribute
// reason - unique constraints are not really working well with NULL values (parent_id instead of this)
// Note: this has also another problem, because for types the field is currently misused... in the long run the table must be splitted
$this->isPropertyOf = (int) $parent->getId();
return $this;
......
......@@ -114,6 +114,7 @@ class AttributeRepository extends EntityRepository {
$queryBuilder = $this->createQueryBuilder('attribute')
->where('attribute.urlName = :urlName')
->andWhere('attribute.isType = TRUE')
->andWhere('attribute.deleted = 0')
->setParameter('urlName', $urlName);
/** @var Query $query */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment