Skip to content

Commit

Permalink
[TASK] Streamline check of TYPO3 branch in use
Browse files Browse the repository at this point in the history
  • Loading branch information
xperseguers committed Nov 25, 2021
1 parent 719cdda commit 7aa2c95
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
4 changes: 1 addition & 3 deletions Classes/Library/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ public static function initialize($mode, \Causal\IgLdapSsoAuth\Domain\Model\Conf
// Select configuration from database, merge with extension configuration template and initialise class attributes.

static::$domains = [];
$typo3Branch = class_exists(\TYPO3\CMS\Core\Information\Typo3Version::class)
? (new \TYPO3\CMS\Core\Information\Typo3Version())->getBranch()
: TYPO3_branch;
$typo3Branch = (new \TYPO3\CMS\Core\Information\Typo3Version())->getBranch();
if (version_compare($typo3Branch, '10.0', '<')) {
$domainUids = GeneralUtility::intExplode(',', $configuration->getDomains(), true);
foreach ($domainUids as $domainUid) {
Expand Down
4 changes: 1 addition & 3 deletions Classes/Task/ImportUsersAdditionalFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ protected function registerSelect(array &$taskInfo, bool $isEdit, array $paramet

// Write the code for the field
$fieldID = 'task_' . $fieldName;
$typo3Branch = class_exists(\TYPO3\CMS\Core\Information\Typo3Version::class)
? (new \TYPO3\CMS\Core\Information\Typo3Version())->getBranch()
: TYPO3_branch;
$typo3Branch = (new \TYPO3\CMS\Core\Information\Typo3Version())->getBranch();
$cssClass = version_compare($typo3Branch, '11.0', '<') ? 'form-control' : 'form-select';
if (isset($parameters['css'])) {
$cssClass .= ' ' . $parameters['css'];
Expand Down
4 changes: 1 addition & 3 deletions Configuration/TCA/tx_igldapssoauth_config.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php
$typo3Branch = class_exists(\TYPO3\CMS\Core\Information\Typo3Version::class)
? (new \TYPO3\CMS\Core\Information\Typo3Version())->getBranch()
: TYPO3_branch;
$typo3Branch = (new \TYPO3\CMS\Core\Information\Typo3Version())->getBranch();
$domainsField = version_compare($typo3Branch, '10.4', '<') ? 'domains,' : '';

return [
Expand Down
4 changes: 1 addition & 3 deletions ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@

if (TYPO3_MODE === 'BE') {
// Add BE module on top of system main module
$typo3Branch = class_exists(\TYPO3\CMS\Core\Information\Typo3Version::class)
? (new \TYPO3\CMS\Core\Information\Typo3Version())->getBranch()
: TYPO3_branch;
$typo3Branch = (new \TYPO3\CMS\Core\Information\Typo3Version())->getBranch();
if (version_compare($typo3Branch, '10.0', '<')) {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'Causal.' . $_EXTKEY,
Expand Down

0 comments on commit 7aa2c95

Please sign in to comment.