Commit df285a2b authored by Fabian Galinski's avatar Fabian Galinski 😾

[BUGFIX] The languagevisibility isn't checked for content, which show pages

parent a488a828
......@@ -2,6 +2,29 @@
namespace TYPO3\Languagevisibility\Xclass;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use Exception;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\Exception\AspectNotFoundException;
......
<?php
namespace TYPO3\Languagevisibility\Xclass;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Core\Context\Exception\AspectNotFoundException;
use TYPO3\Languagevisibility\Service\FrontendServices;
/**
* Class PageRepository
* @package TYPO3\Languagevisibility\Xclass
*/
class PageRepository extends \TYPO3\CMS\Frontend\Page\PageRepository {
/**
* This just checks, if the wanted page is available for the current language with the languagevisibility filters
* from the backend. (The Table)
*
* @inheritdoc
*
* @param int $uid The page id to look up
* @param bool $disableGroupAccessCheck set to true to disable group access check
*
* @return array The resulting page record with overlays or empty array
*
* @throws \UnexpectedValueException
* @throws AspectNotFoundException
* @throws \Exception
*/
public function getPage($uid, $disableGroupAccessCheck = false) {
$page = parent::getPage($uid, $disableGroupAccessCheck);
if (count($page) <= 0) {
return $page;
}
if (FrontendServices::checkVisiblityForElement($page, 'pages', $this->sys_language_uid)) {
return $page;
}
return [];
}
}
......@@ -59,6 +59,8 @@ call_user_func(
['className' => \TYPO3\Languagevisibility\Xclass\Typo3DbBackend::class];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class] =
['className' => \TYPO3\Languagevisibility\Xclass\ContentObjectRenderer::class];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Frontend\Page\PageRepository::class] =
['className' => \TYPO3\Languagevisibility\Xclass\PageRepository::class];
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('mask')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['MASK\Mask\Helper\InlineHelper'] =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment