Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade 10.4 #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions Classes/Controller/FaqController.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ function init($conf)
}
}


$this->templateCode = file_get_contents(GeneralUtility::makeInstance(FilePathSanitizer::class)->sanitize($this->conf['templateFile']));

$this->initCategories(); // initialize category-array
$this->initExperts(); // initialize experts-array

Expand All @@ -298,11 +298,11 @@ function init($conf)
: $this->getTypoScriptFrontendController()->config['config']['sys_language_overlay'];

//$this->conf['iconPlus'] = $this->getTypoScriptFrontendController()->tmpl->getFileName($this->conf['iconPlus']);

$this->conf['iconPlus'] = file_get_contents(GeneralUtility::makeInstance(FilePathSanitizer::class)->sanitize($this->conf['iconPlus']));

//$this->conf['iconMinus'] = $this->getTypoScriptFrontendController()->tmpl->getFileName($this->conf['iconMinus']);

$this->conf['iconMinus'] = file_get_contents(GeneralUtility::makeInstance(FilePathSanitizer::class)->sanitize($this->conf['iconMinus']));
}

Expand All @@ -316,10 +316,10 @@ function initCategories()
{
$rootlineStoragePid = $this->getStorageSiterootPids();

$storagePidCsv = implode(
$storagePidCsv = trim(implode(
', ',
[$rootlineStoragePid['_STORAGE_PID'], $this->conf['pidList']]
);
), ', ');

/** @var QueryBuilder $queryBuilder */
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_irfaq_cat');
Expand Down Expand Up @@ -529,7 +529,7 @@ function getCatMarkerArray($markerArray, $row)

$faq_category = [];


if (GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('workspace', 'id') && $row['_ORIG_uid'] > 0) {
$row['uid'] = $row['_ORIG_uid'];
}
Expand Down Expand Up @@ -611,7 +611,7 @@ function getSelectConfQuery()
);
}


if (GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('workspace', 'id') > 0) {
$queryBuilder->andWhere(
$queryBuilder->expr()->orX(
Expand Down Expand Up @@ -1160,7 +1160,7 @@ protected function initPidList($conf): void
}

protected function getCurrentWorkspaceId()
{
{
return GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('workspace', 'id');
}

Expand Down Expand Up @@ -1231,6 +1231,11 @@ protected function getOverlayedFaqs(array $rows, $sortingStatement = ''): array
}

$ids = $this->getResolver('tx_irfaq_q', array_keys($faqs))->get();

if (!$ids) {
return [];
}

$rows = $this->getQuestionsByUids($ids, $sortingStatement);

return $rows;
Expand Down
23 changes: 7 additions & 16 deletions Classes/Hooks/Comments/CloseCommentsAfterHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
* @author Dmitry Dulepov <[email protected]>
*/

use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Page\PageRepository;

class CloseCommentsAfterHook
Expand Down Expand Up @@ -71,27 +73,16 @@ function irfaqHook(&$params, &$pObj)
function getCloseTime($table, $uid, &$cObj)
{
$result = 0;
$recs = $this->getDatabaseConnection()->exec_SELECTgetRows(
'disable_comments,comments_closetime',
$table,
'uid=' . intval($uid) . PageRepository->enableFields($table);
);
$qb = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
$qb->select('disable_comments', 'comments_closetime')
->from($table)
->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid)));
$recs = $qb->execute()->fetchAll();
if (count($recs)) {
$result = $recs[0]['disable_comments'] ? 0 :
($recs[0]['comments_closetime'] ? $recs[0]['comments_closetime'] : PHP_INT_MAX);
}
return $result;
}

/**
* @return \TYPO3\CMS\Core\Database\DatabaseConnection
*/
protected function getDatabaseConnection()
{
/** @var \TYPO3\CMS\Core\Database\DatabaseConnection $TYPO3_DB */
global $TYPO3_DB;

return $TYPO3_DB;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function getExtensionSummary($params, &$pObj)
}

/**
* @return \TYPO3\CMS\Lang\LanguageService
* @return \TYPO3\CMS\Core\Localization\LanguageService
*/
protected function getLanguageService()
{
Expand Down
8 changes: 7 additions & 1 deletion Configuration/FlexForms/flexform_ds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<label>LLL:EXT:irfaq/Resources/Private/Language/locallang_db.xlf:tx_irfaq.pi_flexform.what_to_display</label>
<config>
<type>select</type>
<renderType>selectMultipleSideBySide</renderType>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:irfaq/Resources/Private/Language/locallang_db.xlf:tx_irfaq.pi_flexform.view_dynamic</numIndex>
Expand Down Expand Up @@ -46,6 +47,7 @@
<label>LLL:EXT:irfaq/Resources/Private/Language/locallang_db.xlf:tx_irfaq.pi_flexform.sorting</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:irfaq/Resources/Private/Language/locallang_db.xlf:tx_irfaq.pi_flexform.sorting_ts</numIndex>
Expand Down Expand Up @@ -94,6 +96,7 @@
<label>LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.recursive</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0"></numIndex>
Expand Down Expand Up @@ -131,6 +134,7 @@
<label>LLL:EXT:irfaq/Resources/Private/Language/locallang_db.xlf:tx_irfaq.pi_flexform.enableRatings</label>
<config>
<type>check</type>
<renderType>checkboxToggle</renderType>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0"></numIndex>
Expand All @@ -156,6 +160,7 @@
<label>LLL:EXT:irfaq/Resources/Private/Language/locallang_db.xlf:tx_irfaq.pi_flexform.select_deselect_categories</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:irfaq/Resources/Private/Language/locallang_db.xlf:tx_irfaq.pi_flexform.category_selection_showAll</numIndex>
Expand All @@ -180,6 +185,7 @@
<label>LLL:EXT:irfaq/Resources/Private/Language/locallang_db.xlf:tx_irfaq.pi_flexform.category_selection</label>
<config>
<type>select</type>
<renderType>selectMultipleSideBySide</renderType>
<items type="array">
<numIndex index="100">
<numIndex index="0">LLL:EXT:irfaq/Resources/Private/Language/locallang_db.xlf:tx_irfaq.pi_flexform.category_selection_notCategorized</numIndex>
Expand Down Expand Up @@ -256,4 +262,4 @@
</ROOT>
</sSEARCH>
</sheets>
</T3DataStructure>
</T3DataStructure>
13 changes: 11 additions & 2 deletions Configuration/TCA/tx_irfaq_cat.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
'config' => [
'type' => 'check',
'default' => '0'
'default' => '0',
'renderType' => 'checkboxToggle',
'items' => [
[
0 => '',
1 => '',
'invertStateDisplay' => true
]
],
]
],
'fe_group' => [
Expand Down Expand Up @@ -79,6 +87,7 @@
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'sys_language',
'special' => 'languages',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => [
['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1],
Expand Down Expand Up @@ -106,4 +115,4 @@
]
],
],
];
];
3 changes: 2 additions & 1 deletion Configuration/TCA/tx_irfaq_expert.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'sys_language',
'special' => 'languages',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => [
['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1],
Expand Down Expand Up @@ -83,4 +84,4 @@
]
],
],
];
];
29 changes: 23 additions & 6 deletions Configuration/TCA/tx_irfaq_q.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
'config' => [
'type' => 'check',
'default' => '0'
'default' => '0',
'renderType' => 'checkboxToggle',
'items' => [
[
0 => '',
1 => '',
'invertStateDisplay' => true
]
],
]
],
'fe_group' => [
Expand Down Expand Up @@ -149,8 +157,12 @@
'l10n_mode' => 'exclude',
'config' => [
'type' => 'check',
'items' => [
['', '']
'renderType' => 'checkboxToggle',
'items' => [
[
0 => '',
1 => '',
]
],
'default' => '1'
]
Expand All @@ -161,8 +173,12 @@
'l10n_mode' => 'exclude',
'config' => [
'type' => 'check',
'items' => [
['', '']
'renderType' => 'checkboxToggle',
'items' => [
[
0 => '',
1 => '',
]
],
'default' => '0'
]
Expand All @@ -185,6 +201,7 @@
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'special' => 'languages',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => [
Expand Down Expand Up @@ -213,4 +230,4 @@
]
],
],
];
];
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"require" : {
"typo3/cms-core" : "^9.5"
"typo3/cms-core" : "^9.5 || ^10.4"
},
"license": ["GPL-2.0-or-later"],
"autoload" : {
Expand All @@ -21,4 +21,4 @@
"vendor-dir" : ".build/vendor",
"bin-dir" : ".build/bin"
}
}
}
6 changes: 3 additions & 3 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
'CGLcompliance_note' => '',
'constraints' => [
'depends' => [
'typo3' => '9.5.0-10.2.99',
'php' => '7.1.0-7.2.99'
'typo3' => '9.5.0-10.4.99',
'php' => '7.1.0-7.4.99'
],
'conflicts' => [],
'suggests' => []
]
];
];
6 changes: 0 additions & 6 deletions ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_irfaq_cat');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_irfaq_expert');



$GLOBALS['TBE_MODULES_EXT']['xMOD_db_new_content_el']['addElClasses']['Netcreators\\Irfaq\\System\\Backend\\WizardIcon'] =
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('irfaq')
. 'Classes/System/Backend/WizardIcon.php';

/** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon(
Expand Down