Skip to content

Commit

Permalink
[BUGFIX] Hand over parent caller object in itemsProcFunc
Browse files Browse the repository at this point in the history
Fixes: #585
  • Loading branch information
nhovratov committed Sep 5, 2023
1 parent 43b5fa3 commit bfda1c6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions Build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -615,11 +615,21 @@ parameters:
count: 1
path: ../../Classes/ItemsProcFuncs/CTypeList.php

-
message: "#^Method MASK\\\\Mask\\\\ItemsProcFuncs\\\\CTypeList\\:\\:itemsProcFunc\\(\\) has parameter \\$parentObj with no type specified\\.$#"
count: 1
path: ../../Classes/ItemsProcFuncs/CTypeList.php

-
message: "#^Method MASK\\\\Mask\\\\ItemsProcFuncs\\\\ColPosList\\:\\:itemsProcFunc\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#"
count: 1
path: ../../Classes/ItemsProcFuncs/ColPosList.php

-
message: "#^Method MASK\\\\Mask\\\\ItemsProcFuncs\\\\ColPosList\\:\\:itemsProcFunc\\(\\) has parameter \\$parentObj with no type specified\\.$#"
count: 1
path: ../../Classes/ItemsProcFuncs/ColPosList.php

-
message: "#^Method MASK\\\\Mask\\\\Loader\\\\JsonLoader\\:\\:__construct\\(\\) has parameter \\$maskExtensionConfiguration with no value type specified in iterable type array\\.$#"
count: 1
Expand Down
4 changes: 2 additions & 2 deletions Classes/ItemsProcFuncs/CTypeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(TableDefinitionCollection $tableDefinitionCollection
/**
* Render the allowed CTypes for nested content elements
*/
public function itemsProcFunc(array &$params): void
public function itemsProcFunc(array &$params, $parentObj): void
{
// if this tt_content element is inline element of mask
if ((int)$params['row']['colPos'] === 999) {
Expand Down Expand Up @@ -74,7 +74,7 @@ public function itemsProcFunc(array &$params): void
GeneralUtility::callUserFunction(
$params['config']['m_itemsProcFunc'],
$params,
$this
$parentObj
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/ItemsProcFuncs/ColPosList.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ColPosList
* Render the allowed colPos for nested content elements
* @param array $params
*/
public function itemsProcFunc(&$params): void
public function itemsProcFunc(&$params, $parentObj): void
{
// if this tt_content element is inline element of mask
if ((int)$params['row']['colPos'] === 999) {
Expand All @@ -49,7 +49,7 @@ public function itemsProcFunc(&$params): void
GeneralUtility::callUserFunction(
$params['config']['m_itemsProcFunc'],
$params,
$this
$parentObj
);
}
}
Expand Down

0 comments on commit bfda1c6

Please sign in to comment.