Skip to content

Commit

Permalink
Merge pull request #13 from nwm-dev/master
Browse files Browse the repository at this point in the history
Restrict non-numeric mask fields to language of current row
  • Loading branch information
Gregor Agnes authored Nov 22, 2022
2 parents 1af4b45 + effc1b7 commit e5b7baf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Classes/AdditionalContentFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function modifyContentFromContentElement(string &$bodytext, array $ttCont
// it's a dependend table, index the columns from the dependent table
$maskColumnsOfDependentTable = preg_split('/,/', $this->getMaskFieldsFromTable($column), null, PREG_SPLIT_NO_EMPTY);
if ($maskColumnsOfDependentTable) {
$bodytext = $this->getContentFromMaskFields($ttContentRow['pid'], $column, $maskColumnsOfDependentTable);
$bodytext = $this->getContentFromMaskFields($ttContentRow['pid'], $column, $maskColumnsOfDependentTable, $ttContentRow['sys_language_uid']);
}
}
}
Expand All @@ -90,7 +90,7 @@ public function modifyContentFromContentElement(string &$bodytext, array $ttCont
* @param arry $columns
* @return string
*/
private function getContentFromMaskFields($pid, $table, $columns)
private function getContentFromMaskFields($pid, $table, $columns, $sys_language_uid)
{$queryBuilder = Db::getQueryBuilder($table);
$pageQuery = $queryBuilder
->select(...$columns)
Expand All @@ -99,6 +99,10 @@ private function getContentFromMaskFields($pid, $table, $columns)
$queryBuilder->expr()
->eq(
'pid', $queryBuilder->createNamedParameter($pid)
),
$queryBuilder->expr()
->eq(
'sys_language_uid', $queryBuilder->createNamedParameter($sys_language_uid)
)
)
->execute();
Expand Down

0 comments on commit e5b7baf

Please sign in to comment.