Skip to content

Commit

Permalink
[BUGFIX] Ignore deleted form elements for form's reference count
Browse files Browse the repository at this point in the history
The usage count of forms in the form module must not count deleted
elements.

Resolves: #92880
Releases: master, 10.4
Change-Id: Ia58c4e28e03ea1caa3b22ba1188d039fcdea69ea
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66677
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
georgringer authored and lolli42 committed Nov 20, 2020
1 parent 116273b commit 8859c62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion typo3/sysext/form/Classes/Service/DatabaseService.php
Expand Up @@ -116,7 +116,10 @@ protected function getAllReferences(string $column): array

$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_refindex');

$constraints = [$queryBuilder->expr()->eq('softref_key', $queryBuilder->createNamedParameter('formPersistenceIdentifier', \PDO::PARAM_STR))];
$constraints = [
$queryBuilder->expr()->eq('softref_key', $queryBuilder->createNamedParameter('formPersistenceIdentifier', \PDO::PARAM_STR)),
$queryBuilder->expr()->eq('deleted', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
];

if ($column === 'ref_string') {
$constraints[] = $queryBuilder->expr()->neq('ref_string', $queryBuilder->createNamedParameter('', \PDO::PARAM_STR));
Expand Down

0 comments on commit 8859c62

Please sign in to comment.