Use pageinfo and remove extension scanner false positive
As only pageinfo is used, only this is stored for now. Also the single line accessing the property is marked to be ignored by extension scanner.
This commit is contained in:
parent
e5e5321140
commit
19ddacb246
1 changed files with 10 additions and 9 deletions
|
@ -29,15 +29,16 @@ use TYPO3\CMS\Frontend\Resource\FileCollector;
|
||||||
class PageLayoutHeader
|
class PageLayoutHeader
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var PageLayoutController
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $pageLayoutController;
|
private $pageinfo;
|
||||||
|
|
||||||
public function render(
|
public function render(
|
||||||
array $params,
|
array $params,
|
||||||
PageLayoutController $pageLayoutController
|
PageLayoutController $pageLayoutController
|
||||||
): string {
|
): string {
|
||||||
$this->pageLayoutController = $pageLayoutController;
|
// @extensionScannerIgnoreLine At least in v10 this is a false positive
|
||||||
|
$this->pageinfo = $pageLayoutController->pageinfo;
|
||||||
|
|
||||||
// TODO: Check whether two levels up is uid 2, which holds all blog posts
|
// TODO: Check whether two levels up is uid 2, which holds all blog posts
|
||||||
// To prevent rendering on non blog posts
|
// To prevent rendering on non blog posts
|
||||||
|
@ -45,29 +46,29 @@ class PageLayoutHeader
|
||||||
|
|
||||||
$view = $this->getView();
|
$view = $this->getView();
|
||||||
$view->assignMultiple([
|
$view->assignMultiple([
|
||||||
'record' => $this->pageLayoutController->pageinfo,
|
'record' => $this->pageinfo,
|
||||||
'metaInfo' => [
|
'metaInfo' => [
|
||||||
[
|
[
|
||||||
'label' => 'meta-description',
|
'label' => 'meta-description',
|
||||||
'value' => $this->pageLayoutController->pageinfo['description'],
|
'value' => $this->pageinfo['description'],
|
||||||
'field' => 'description',
|
'field' => 'description',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => 'introduction',
|
'label' => 'introduction',
|
||||||
'value' => $this->pageLayoutController->pageinfo['abstract'],
|
'value' => $this->pageinfo['abstract'],
|
||||||
'field' => 'abstract',
|
'field' => 'abstract',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => 'published',
|
'label' => 'published',
|
||||||
'value' => $this->pageLayoutController->pageinfo['lastUpdated'],
|
'value' => $this->pageinfo['lastUpdated'],
|
||||||
'field' => 'lastUpdated',
|
'field' => 'lastUpdated',
|
||||||
'type' => 'date',
|
'type' => 'date',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => 'updated',
|
'label' => 'updated',
|
||||||
'value' => $this->pageLayoutController->pageinfo['SYS_LASTCHANGED'],
|
'value' => $this->pageinfo['SYS_LASTCHANGED'],
|
||||||
'type' => 'date',
|
'type' => 'date',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -90,7 +91,7 @@ class PageLayoutHeader
|
||||||
|
|
||||||
private function resolvePageMedia(): array
|
private function resolvePageMedia(): array
|
||||||
{
|
{
|
||||||
$page = ['uid' => $this->pageLayoutController->pageinfo['uid']];
|
$page = ['uid' => $this->pageinfo['uid']];
|
||||||
$files = new FileCollector();
|
$files = new FileCollector();
|
||||||
$files->addFilesFromRelation('pages', 'media', $page);
|
$files->addFilesFromRelation('pages', 'media', $page);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue