Skip to content

Commit

Permalink
Merge pull request #7 from nitsan-technologies/feature/stability-v11
Browse files Browse the repository at this point in the history
Feature/stability v11
  • Loading branch information
nitsan-technologies authored Aug 30, 2024
2 parents 648e57f + ca6d877 commit de8514d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/CommentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function listAction()
$pid = $GLOBALS['TSFE']->id;
$setting = $this->settings;
if ($pid) {
$comments = $this->commentRepository->getCommentsByPage($pid,$setting['commnetlanguageFallbackMode'])->toArray();
$comments = $this->commentRepository->getCommentsByPage($pid)->toArray();
$paths = $this->captchaVerificationPath();

$captcha_path = $paths['captcha'] . '?' . rand();
Expand Down
13 changes: 2 additions & 11 deletions Classes/Domain/Repository/CommentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,14 @@ class CommentRepository extends Repository
*
* @param $pageId
*/
public function getCommentsByPage($pageId, $mode)
public function getCommentsByPage($pageId)
{
if (version_compare(TYPO3_branch, '9.0', '>')) {
$context = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Context\Context::class);
$languageId = $context->getPropertyFromAspect('language', 'id');
} else {
$languageId = $GLOBALS['TSFE']->sys_language_uid;
}

$query = $this->createQuery();
$queryArr = [
$query->equals('pageuid', $pageId),
$query->equals('comment', 0),
];
if ($mode > 0) {
$query->getQuerySettings()->setRespectSysLanguage(false);
$queryArr[] = $query->equals('sys_language_uid', $languageId);
}
$query->matching($query->logicalAnd($queryArr));
$query->setOrderings(['crdate' => QueryInterface::ORDER_DESCENDING]);
$query->getQuerySettings()->setRespectStoragePage(false);
Expand Down
19 changes: 0 additions & 19 deletions Configuration/FlexForm/FlexForm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,6 @@
</TCEforms>
<type>array</type>
<el>
<settings.commnetlanguageFallbackMode>
<TCEforms>
<label>LLL:EXT:ns_comments/Resources/Private/Language/locallang_db.xlf:flexform.languageFallbackMode</label>
<config>
<type>radio</type>
<items>
<numIndex index="0">
<numIndex index="0">LLL:EXT:ns_comments/Resources/Private/Language/locallang_db.xlf:flexform.languageFallbackMode.strict</numIndex>
<numIndex index="1">0</numIndex>
</numIndex>
<numIndex index="1">
<numIndex index="0">LLL:EXT:ns_comments/Resources/Private/Language/locallang_db.xlf:flexform.languageFallbackMode.translated</numIndex>
<numIndex index="1">1</numIndex>
</numIndex>
</items>
<default>0</default>
</config>
</TCEforms>
</settings.commnetlanguageFallbackMode>
<settings.custom>
<TCEforms>
<label>LLL:EXT:ns_comments/Resources/Private/Language/locallang_db.xlf:flexform.custom</label>
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'uploadfolder' => '0',
'createDirs' => '',
'clearCacheOnLoad' => 0,
'version' => '2.2.0',
'version' => '2.2.1',
'constraints' => [
'depends' => [
'typo3' => '8.0.0-11.5.99',
Expand Down

0 comments on commit de8514d

Please sign in to comment.