Skip to content

Commit 7085cf2

Browse files
committed
Revert "[BUGFIX] Prevent exception on form submit "getContentObject() on null""
This reverts commit dd72729.
1 parent 2553654 commit 7085cf2

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Classes/Finisher/SaveToAnyTableFinisher.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@
1010
use TYPO3\CMS\Extbase\Object\Exception;
1111
use TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotException;
1212
use TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotReturnException;
13+
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
1314

1415
/**
1516
* Class SaveToAnyTableFinisher
1617
*/
1718
class SaveToAnyTableFinisher extends AbstractFinisher implements FinisherInterface
1819
{
20+
21+
/**
22+
* @var ContentObjectRenderer
23+
*/
24+
protected $contentObject;
25+
1926
/**
2027
* @var array
2128
*/
@@ -227,4 +234,13 @@ public function initializeFinisher(): void
227234
$this->addArrayToDataArray($mailRepository->getVariablesWithMarkersFromMail($this->mail));
228235
}
229236
}
237+
238+
/**
239+
* @param ContentObjectRenderer $contentObject
240+
* @return void
241+
*/
242+
public function injectContentObject(ContentObjectRenderer $contentObject): void
243+
{
244+
$this->contentObject = $contentObject;
245+
}
230246
}

Classes/Finisher/SendParametersFinisher.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@
1515
*/
1616
class SendParametersFinisher extends AbstractFinisher implements FinisherInterface
1717
{
18+
1819
/**
1920
* @var ConfigurationManagerInterface
2021
*/
2122
protected $configurationManager;
2223

24+
/**
25+
* @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
26+
*/
27+
protected $contentObject = null;
28+
2329
/**
2430
* TypoScript configuration part sendPost
2531
*
@@ -123,6 +129,8 @@ protected function isEnabled(): bool
123129
*/
124130
public function initializeFinisher(): void
125131
{
132+
// @extensionScannerIgnoreLine Seems to be a false positive: getContentObject() is still correct in 9.0
133+
$this->contentObject = $this->configurationManager->getContentObject();
126134
$mailRepository = ObjectUtility::getObjectManager()->get(MailRepository::class);
127135
$this->contentObject->start($mailRepository->getVariablesWithMarkersFromMail($this->mail));
128136
$configurationService = ObjectUtility::getObjectManager()->get(ConfigurationService::class);

0 commit comments

Comments
 (0)