Skip to content
Snippets Groups Projects
Commit a4a919ba authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fix possible nullpointer exception, fixing flexform query

parent 8d8b0c2c
No related branches found
No related tags found
No related merge requests found
......@@ -59,9 +59,9 @@ class ListByCategoryController extends AbstractController {
*
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
*/
public function initializeIndexAction(){
public function initializeIndexAction() {
$currentPageBrowserPage = (int) GeneralUtility::_GP('tx_sgnews_pagebrowser')['currentPage'];
if($currentPageBrowserPage > 0){
if ($currentPageBrowserPage > 0) {
$this->request->setArgument('currentPageBrowserPage', $currentPageBrowserPage);
}
}
......@@ -94,8 +94,12 @@ class ListByCategoryController extends AbstractController {
$categories = [];
foreach ($categoryUids as $categoryUid) {
$category = $this->categoryRepository->findByUid($categoryUid);
if (!$category) {
continue;
}
$categories[$categoryUid] = $category;
if ($category->_getProperty('_languageUid')>0) {
if ($category->_getProperty('_languageUid') > 0) {
$originalLangCategory = $this->categoryRepository->findOriginalLanguageById($category->getUid());
if ($originalLangCategory) {
$categoriesById[$originalLangCategory->getUid()] = $originalLangCategory;
......
......@@ -31,7 +31,7 @@
<size>5</size>
<maxitems>99</maxitems>
<foreign_table>pages</foreign_table>
<foreign_table_where>AND sys_language_uid IN (-1, 0) AND doktype = 117 ORDER BY title</foreign_table_where>
<foreign_table_where>AND pages.sys_language_uid IN (-1, 0) AND pages.doktype = 117 ORDER BY pages.title</foreign_table_where>
</config>
</TCEforms>
</settings.categories>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment