Skip to content

Commit 17c555b

Browse files
authored
Merge pull request #13 from 80Quattro/input_label
[BUGFIX] Empty input label
2 parents 5a9bf60 + 8f5959d commit 17c555b

File tree

7 files changed

+18
-11
lines changed

7 files changed

+18
-11
lines changed

.github/workflows/core11.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php }} -s lint
2828

2929
- name: Validate code against CGL
30-
run: PHP_CS_FIXER_IGNORE_ENV=1 Build/Scripts/runTests.sh -t 11 -p 8.1 -s cgl -n
30+
run: PHP_CS_FIXER_IGNORE_ENV=1 Build/Scripts/runTests.sh -t 11 -p 8.2 -s cgl -n
3131

3232
- name: Unit Tests
33-
run: Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php }} -s unit
33+
run: Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php }} -s unit

.github/workflows/core12.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php }} -s lint
2525

2626
- name: Validate code against CGL
27-
run: PHP_CS_FIXER_IGNORE_ENV=1 Build/Scripts/runTests.sh -t 12 -p 8.1 -s cgl -n
27+
run: PHP_CS_FIXER_IGNORE_ENV=1 Build/Scripts/runTests.sh -t 12 -p 8.2 -s cgl -n
2828

2929
- name: Unit Tests
30-
run: Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php }} -s unit
30+
run: Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php }} -s unit

Build/php-cs-fixer/php-cs-fixer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
->setRiskyAllowed(true)
2323
->setRules([
2424
'@DoctrineAnnotation' => true,
25-
'@PER' => true,
25+
'@PER-CS' => true,
2626
'array_syntax' => ['syntax' => 'short'],
2727
'blank_line_after_opening_tag' => true,
2828
'control_structure_braces' => true,
@@ -45,7 +45,6 @@
4545
'no_blank_lines_after_phpdoc' => true,
4646
'no_empty_phpdoc' => true,
4747
'no_empty_statement' => true,
48-
'no_extra_blank_lines' => true,
4948
'no_leading_import_slash' => true,
5049
'no_leading_namespace_whitespace' => true,
5150
'no_null_property_initialization' => true,

Resources/Private/Form/Partials/Friendlycaptcha.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@
99
<f:then>
1010
<f:asset.script defer="1" async="1" identifier="friendlycaptcha" src="{captchaConfiguration.jsPath}" />
1111

12-
<f:render partial="Field/Field" arguments="{element: element, doNotShowLabel: 1}" contentAs="elementContent">
12+
<f:if condition="{element.label} == ''">
13+
<f:then>
14+
<f:variable name="dontShowLabel" value="1" />
15+
</f:then>
16+
<f:else>
17+
<f:variable name="dontShowLabel" value="0" />
18+
</f:else>
19+
</f:if>
20+
<f:render partial="Field/Field" arguments="{element: element, doNotShowLabel: dontShowLabel}" contentAs="elementContent">
1321
<f:form.hidden
1422
property="{element.identifier}"
1523
id="{element.uniqueIdentifier}"
1624
value="1"
17-
additionalAttributes="{formvh:translateElementProperty(element: element, property: 'fluidAdditionalAttributes')}"
25+
additionalAttributes="{f:if(condition: \"{element.label} == ''\", then: \"{aria-label:'Friendly Captcha'}\")}"
1826
/>
1927
<div class="frc-captcha" data-sitekey="{captchaConfiguration.siteKey}" data-lang="{captchaConfiguration.languageIsoCode}" data-puzzle-endpoint="{captchaConfiguration.puzzleUrl}"></div>
2028
</f:render>

Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ public function __construct() {}
3030
'puzzleUrl' => 'https://puzzle',
3131
'jsPath' => 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/widget-0.9.12.min.js',
3232
'enabled' => true,
33-
], ConfigurationViewHelper::renderStatic([], static fn () => '', $renderingContext));
33+
], ConfigurationViewHelper::renderStatic([], static fn() => '', $renderingContext));
3434
}
3535
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"typo3/cms-form": "^11.5.30 || ^12.4.5",
1414
"phpunit/phpunit": "^9",
1515
"typo3/coding-standards": "^0.5.3",
16-
"friendsofphp/php-cs-fixer": "^3.13.0",
16+
"friendsofphp/php-cs-fixer": "^3.51.0",
1717
"webmozart/assert": "^1.11.0"
1818
},
1919
"suggest": {

ext_emconf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
],
1818
],
1919
'state' => 'beta',
20-
'version' => '0.1.1',
20+
'version' => '0.1.2',
2121
];

0 commit comments

Comments
 (0)