Skip to content

Commit

Permalink
[BUGFIX] Fix contentobjectdata
Browse files Browse the repository at this point in the history
  • Loading branch information
georgringer committed Jul 7, 2024
1 parent 2a8e426 commit ec9f1e6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Classes/Controller/AddressController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
use TYPO3\CMS\Extbase\Reflection\ObjectAccess;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;

class AddressController extends ActionController
{
Expand Down Expand Up @@ -58,9 +60,13 @@ public function showAction(?Address $address = null)
CacheUtility::addCacheTagsByAddressRecords([$address]);
}

$currentContentObject = $this->request->getAttribute('currentContentObject');
$contentData = $currentContentObject instanceof ContentObjectRenderer ? $currentContentObject->data : [];


$this->view->assignMultiple([
'address' => $address,
'contentObjectData' => $this->request->getAttribute('currentContentObject', []),
'contentObjectData' => $contentData,
]);
return $this->htmlResponse();
}
Expand All @@ -71,7 +77,8 @@ public function showAction(?Address $address = null)
*/
public function listAction(?array $override = [])
{
$contentData = $this->request->getAttribute('currentContentObject', []);
$currentContentObject = $this->request->getAttribute('currentContentObject');
$contentData = $currentContentObject instanceof ContentObjectRenderer ? $currentContentObject->data : [];
$demand = $this->createDemandFromSettings();

if (isset($contentData['first_name'], $contentData['birthday']) && (int) ($this->settings['insertRecord'] ?? 0) === 1) {
Expand Down

0 comments on commit ec9f1e6

Please sign in to comment.