Skip to content

Commit

Permalink
Bugfix, when no categories are assigned to services
Browse files Browse the repository at this point in the history
  • Loading branch information
Achim Strohm committed Aug 28, 2024
1 parent 8d7e62b commit 590fc7f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
20 changes: 11 additions & 9 deletions Classes/Controller/ConsentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ private function klaroConfigBuild(\TYPO3\CMS\Extbase\Persistence\Generic\QueryRe
'storageName' => $this->settings['klaro']['storageName'],
'stylePrefix' => $this->settings['klaro']['stylePrefix'],
'testing' => $this->settings['klaro']['testing'] === '1',
'consentMode' => $this->settings['klaro']['consentMode'] === '1',
'consentModev2' => $this->settings['klaro']['consentModev2'] === '1',
'consentMode' => $this->settings['klaro']['consentMode'] === '1',
'consentModev2' => $this->settings['klaro']['consentModev2'] === '1',
'translations' => [
'en' => [
'consentModal' => [
Expand Down Expand Up @@ -244,13 +244,15 @@ private function klaroConfigBuild(\TYPO3\CMS\Extbase\Persistence\Generic\QueryRe
}
}

// Sort the sys_categories alphabetically and add a last category 'unknown' for uncategorized services.
// Only relevant if option 'groupByPurpose' is set to true.
ksort($klaroConfig['purposeOrder']);
$result = array_values($klaroConfig['purposeOrder']);
$klaroConfig['purposeOrder'] = $result;
$klaroConfig['purposeOrder'][] = 'unknown';
if($klaroConfig['purposeOrder']) {
// Sort the sys_categories alphabetically and add a last category 'unknown' for uncategorized services.
// Only relevant if option 'groupByPurpose' is set to true.
ksort($klaroConfig['purposeOrder']);
$result = array_values($klaroConfig['purposeOrder']);
$klaroConfig['purposeOrder'] = $result;
$klaroConfig['purposeOrder'][] = 'unknown';
}

return $klaroConfig;
}
}
}
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [4.1.0] - 2024-08-28 - AS
### Fixed
- Bugfix, when no categories are assigned to services

## [4.0.9] - 2024-08-27 - RL
### Fixed
- Undo: GTM-Service Partial - Tag loading from v4.0.8
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'uploadfolder' => false,
'clearcacheonload' => false,
'clearCacheOnLoad' => 0,
'version' => '4.0.9',
'version' => '4.1.0',
'constraints' =>
array (
'depends' =>
Expand Down

0 comments on commit 590fc7f

Please sign in to comment.