Skip to content

Commit d062f1a

Browse files
committed
v115.1.1
1 parent deaa275 commit d062f1a

33 files changed

+266
-412
lines changed

Classes/Command/DomainTagController.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

Classes/Controller/AbstractController.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,13 @@ protected function callActionMethod(RequestInterface $request): ResponseInterfac
6363
try {
6464
$response = parent::callActionMethod($request);
6565
} catch (AuthenticationException $e) {
66-
$response = new Response($e->getMessage(), 403);
66+
$response = new Response(statusCode: 403, reasonPhrase: $e->getMessage());
6767
} catch (TermsException $e) {
6868
$response = new RedirectResponse($this->addBaseUriIfNecessary($e->getUrl()), 303);
6969
}
70-
$origin = $_SERVER['HTTP_ORIGIN'] ?? '';
71-
if ($this->isAjax && $origin) {
70+
if ($this->isAjax) {
7271
$response = $response
73-
->withHeader('Access-Control-Allow-Origin', $origin)
72+
->withHeader('Access-Control-Allow-Origin', $_SERVER['HTTP_ORIGIN'] ?? '*')
7473
->withHeader('Access-Control-Allow-Credentials', 'true');
7574
}
7675
return $response;

Classes/Controller/SkillPathController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function listAction(bool $includeFullSkills = false, string $apiKey = '')
6969
'brand',
7070
'certificate',
7171
'legitimationDate',
72+
'tags',
7273
'firstCategoryTitle',
7374
];
7475
$descendConfig = [
@@ -239,6 +240,7 @@ public function showApiAction(SkillPath $set = null, bool $includeFullSkills = f
239240
'progressPercentage',
240241
'brand',
241242
'certificate',
243+
'tags',
242244
'firstCategoryTitle',
243245
],
244246
'_descend' => [
@@ -270,6 +272,14 @@ public function showApiAction(SkillPath $set = null, bool $includeFullSkills = f
270272
'progress' => [],
271273
'progressPercentage' => [],
272274
'brand' => Brand::JsonViewMinimalConfiguration,
275+
'tags' => [
276+
'_descendAll' => [
277+
'_only' => [
278+
'uid',
279+
'title',
280+
],
281+
],
282+
],
273283
],
274284
],
275285
];

Classes/Controller/StatisticsController.php

Lines changed: 0 additions & 48 deletions
This file was deleted.

Classes/Domain/Model/Certification.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,22 @@ class Certification extends AbstractEntity
4343
'_only' => [
4444
'uid',
4545
'name',
46+
'tags',
4647
'mediaPublicUrl',
4748
'brand',
49+
'tags',
4850
'firstCategoryTitle',
4951
],
5052
'_descend' => [
5153
'brand' => Brand::JsonViewMinimalConfiguration,
54+
'tags' => [
55+
'_descendAll' => [
56+
'_only' => [
57+
'uid',
58+
'title',
59+
],
60+
],
61+
],
5262
],
5363
],
5464
];

Classes/Domain/Model/Skill.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class Skill extends AbstractEntity
147147
* @Lazy
148148
* @Cascade("remove")
149149
*/
150-
protected FileReference|LazyLoadingProxy|null $image;
150+
protected FileReference|LazyLoadingProxy|null $image = null;
151151

152152
/**
153153
* @var ObjectStorage<Brand>

Classes/Domain/Model/SkillPath.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
use TYPO3\CMS\Core\Cache\CacheManager;
2222
use TYPO3\CMS\Core\Utility\GeneralUtility;
2323
use TYPO3\CMS\Extbase\Annotation\ORM\Cascade;
24+
use TYPO3\CMS\Extbase\Annotation\ORM\Lazy;
2425
use TYPO3\CMS\Extbase\Annotation\Validate;
2526
use TYPO3\CMS\Extbase\Domain\Model\Category;
2627
use TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository;
2728
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
29+
use TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage;
2830
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
2931

3032
class SkillPath extends AbstractEntity
@@ -37,10 +39,19 @@ class SkillPath extends AbstractEntity
3739
'mediaPublicUrl',
3840
'progressPercentage',
3941
'legitimationDate',
42+
'tags',
4043
'firstCategoryTitle',
4144
],
4245
'_descend' => [
4346
'progressPercentage' => [],
47+
'tags' => [
48+
'_descendAll' => [
49+
'_only' => [
50+
'uid',
51+
'title',
52+
],
53+
],
54+
],
4455
],
4556
];
4657

@@ -52,10 +63,19 @@ class SkillPath extends AbstractEntity
5263
'mediaPublicUrl',
5364
'brand',
5465
'skillCount',
66+
'tags',
5567
'firstCategoryTitle',
5668
],
5769
'_descend' => [
5870
'brand' => Brand::JsonViewMinimalConfiguration,
71+
'tags' => [
72+
'_descendAll' => [
73+
'_only' => [
74+
'uid',
75+
'title',
76+
],
77+
],
78+
],
5979
],
6080
];
6181

@@ -96,6 +116,12 @@ class SkillPath extends AbstractEntity
96116
*/
97117
protected ObjectStorage $links;
98118

119+
/**
120+
* @var ObjectStorage<Tag>
121+
* @Lazy
122+
*/
123+
protected ObjectStorage|LazyObjectStorage $tags;
124+
99125
/**
100126
* @var ObjectStorage<Category>
101127
*/
@@ -127,6 +153,7 @@ public function __construct()
127153
$this->skills = new ObjectStorage();
128154
$this->media = new ObjectStorage();
129155
$this->links = new ObjectStorage();
156+
$this->tags = new ObjectStorage();
130157
$this->categories = new ObjectStorage();
131158
}
132159

@@ -426,6 +453,31 @@ public function getLinks(): ObjectStorage
426453
return $this->links;
427454
}
428455

456+
public function addTag(Tag $tag): void
457+
{
458+
$this->tags->attach($tag);
459+
}
460+
461+
public function removeTag(Tag $tagToRemove): void
462+
{
463+
$this->tags->detach($tagToRemove);
464+
}
465+
466+
/**
467+
* Returns the tags
468+
*
469+
* @return ObjectStorage<Tag>
470+
*/
471+
public function getTags(): ObjectStorage
472+
{
473+
return $this->tags;
474+
}
475+
476+
public function setTags(ObjectStorage $tags): void
477+
{
478+
$this->tags = $tags;
479+
}
480+
429481
public function getSyllabusLayoutFile(): int
430482
{
431483
return $this->syllabusLayoutFile;

Classes/Domain/Repository/SkillPathRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ public function getSkillsForSyllabusDownload(SkillPath $skillSet): array
108108
foreach ($skillSet->getSkills() as $skill) {
109109
$skills[$skill->getDomainTag() ? $skill->getDomainTag()->getTitle() : '-'][] = $skill;
110110
}
111-
if ($skills['-']) {
111+
// move those without domain tag to last position in the array
112+
if (!empty($skills['-'])) {
112113
$noDomainSkills = $skills['-'];
113114
unset($skills['-']);
114115
$skills['-'] = $noDomainSkills;

Classes/Routing/RestApiEnhancer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function enhanceForGeneration(RouteCollection $collection, array $origina
6060
// store all found possible query parameters to remove them during inflation from the parameters to avoid
6161
// a cHash being generated for them
6262
$this->queryMapping[$queryParam] = $actionParamName;
63-
$deflatedQueryParams[$queryParam] = $parameters[$this->namespace][$actionParamName];
63+
$deflatedQueryParams[$queryParam] = $parameters[$this->namespace][$actionParamName] ?? '';
6464
unset($parameters[$this->namespace][$actionParamName]);
6565
}
6666
// contains all given parameters, even if not used as variables in route

Classes/Service/VerificationService.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ public function moveVerifications(Skill $source, array $targets): void
539539
{
540540
$setGroup = count($targets) > 1;
541541
$certs = $this->certificationRepository->findBySkill($source);
542+
$tags = [];
542543
foreach ($certs as $cert) {
543544
if (!$cert->getRequestGroup() && $setGroup) {
544545
$cert->setRequestGroup('skillSplit-' . time());
@@ -549,7 +550,12 @@ public function moveVerifications(Skill $source, array $targets): void
549550
$this->certificationRepository->add($newCert);
550551
$newCert = $cert->copy();
551552
}
553+
if ($cert->getUser()) {
554+
$tags[] = $source->getCacheTag($cert->getUser()->getUid());
555+
}
552556
}
557+
558+
GeneralUtility::makeInstance(CacheManager::class)->flushCachesByTags($tags);
553559
}
554560

555561
/**

Configuration/TCA/Overrides/fe_users.php

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
'config' => [
2121
'type' => 'check',
2222
'items' => [
23-
1 => [
24-
0 => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled',
25-
],
23+
['LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled'],
2624
],
2725
'default' => 0,
2826
],
@@ -33,9 +31,7 @@
3331
'config' => [
3432
'type' => 'check',
3533
'items' => [
36-
1 => [
37-
0 => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled',
38-
],
34+
['LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled'],
3935
],
4036
'default' => 0,
4137
],
@@ -125,9 +121,7 @@
125121
'config' => [
126122
'type' => 'check',
127123
'items' => [
128-
1 => [
129-
0 => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled',
130-
],
124+
['LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled'],
131125
],
132126
'default' => 1,
133127
],
@@ -151,9 +145,7 @@
151145
'config' => [
152146
'type' => 'check',
153147
'items' => [
154-
1 => [
155-
0 => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled',
156-
],
148+
['LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled'],
157149
],
158150
'default' => 0,
159151
],
@@ -229,7 +221,7 @@
229221
'config' => [
230222
'type' => 'input',
231223
'renderType' => 'inputDateTime',
232-
'eval' => 'int,datetime',
224+
'eval' => 'datetime',
233225
'default' => 0,
234226
'readOnly' => true,
235227
],
@@ -264,9 +256,7 @@
264256
'config' => [
265257
'type' => 'check',
266258
'items' => [
267-
1 => [
268-
0 => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled',
269-
],
259+
['LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enabled'],
270260
],
271261
'default' => 0,
272262
],
@@ -307,7 +297,7 @@
307297
'config' => [
308298
'type' => 'input',
309299
'renderType' => 'inputDateTime',
310-
'eval' => 'int,datetime',
300+
'eval' => 'datetime',
311301
'default' => 0,
312302
'readOnly' => true,
313303
],

0 commit comments

Comments
 (0)