Skip to content

Commit 9c66882

Browse files
committed
Fix cgl and add placeholder
1 parent db5c68f commit 9c66882

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

Classes/Settings/Type/FileType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function transformValue(mixed $value, SettingDefinition $definition): arr
5353
return $definition->default;
5454
}
5555

56-
return array_map(static fn(array|object $entry) => is_object($entry) ? (array)$entry : $entry, $value);
56+
return array_map(static fn (array|object $entry) => is_object($entry) ? (array)$entry : $entry, $value);
5757
}
5858

5959
public function doValidate(array $value, SettingDefinition $definition): bool
@@ -62,7 +62,7 @@ public function doValidate(array $value, SettingDefinition $definition): bool
6262
if (is_object($v)) {
6363
$v = (array)$v;
6464
}
65-
if (!is_array($v) || !isset($v['dataProcessingService']) || (!isset($v['file']) && !isset($v['value']))) {
65+
if (!is_array($v) || '' === ($v['dataProcessingService'] ?? '') || ('' === ($v['file'] ?? '') && '' === ($v['value'] ?? ''))) {
6666
return false;
6767
}
6868
}

Configuration/JavaScriptModules.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/*
4+
* This file is part of the package t3g/usercentrics.
5+
*
6+
* For the full copyright and license information, please read the
7+
* LICENSE file that was distributed with this source code.
8+
*/
9+
310
return [
411
'dependencies' => [
512
'backend'

Resources/Public/JavaScript/settings/type/uc-file.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { html } from 'lit';
2-
import { customElement, property } from 'lit/decorators.js';
32
import { live } from 'lit/directives/live.js';
43
import { BaseElement } from '@typo3/backend/settings/type/base.js';
54

@@ -11,7 +10,7 @@ const defaultEntry = {
1110
value: '',
1211
};
1312

14-
export class UcfileTypeElement extends BaseElement {
13+
export class UcFileTypeElement extends BaseElement {
1514

1615
static properties = {
1716
value: { type: Array },
@@ -40,6 +39,7 @@ export class UcfileTypeElement extends BaseElement {
4039
class="form-control"
4140
?readonly=${this.readonly}
4241
.value=${live(value[propertyName] ?? '')}
42+
placeholder="${propertyName}"
4343
@change=${(e) => this.updateValue(e.target.value, index, propertyName)}
4444
/>
4545
</td>
@@ -67,13 +67,13 @@ export class UcfileTypeElement extends BaseElement {
6767
<div class="table-fit">
6868
<table class="table table-hover">
6969
<tbody>
70-
${this.value.map((v, i) => this.renderItem(v, i))}
70+
${this.value.map((v, i) => this.renderItem(v, i))}
7171
</tbody>
7272
</table>
7373
</div>
7474
</div>
7575
`;
7676
}
77-
};
77+
}
7878

79-
window.customElements.define(componentName, UcfileTypeElement);
79+
window.customElements.define(componentName, UcFileTypeElement);

0 commit comments

Comments
 (0)