Skip to content

Commit bb40585

Browse files
authored
fix: use integer values for f:be.infobox state for v13 compatibility (#93)
## Summary - Replace `ContextualFeedbackSeverity` enum constants with integer values in `f:be.infobox` `state` attribute - The `state` parameter is typed as `int` in TYPO3 v13 but `mixed` in v14; using the enum object causes 503 errors on v13 - Integer values work correctly on both v13 and v14 ## Affected files - 8 Fluid template files, 13 occurrences total - Values: INFO=-1, OK=0, WARNING=1, ERROR=2
2 parents 3500d44 + 1e5e210 commit bb40585

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

Resources/Private/Templates/Audit/List.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ <h2 class="h5 mb-3 mt-4">{date}</h2>
188188
</f:if>
189189
</f:then>
190190
<f:else>
191-
<f:be.infobox title="No Audit Entries" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}">
191+
<f:be.infobox title="No Audit Entries" state="-1">
192192
<f:translate key="LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.xlf:audit.empty" />
193193
</f:be.infobox>
194194
</f:else>

Resources/Private/Templates/Audit/VerifyChain.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ <h1><f:translate key="LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.
99

1010
<f:if condition="{valid}">
1111
<f:then>
12-
<f:be.infobox title="{f:translate(key: 'LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.xlf:audit.chain_valid')}" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::OK')}">
12+
<f:be.infobox title="{f:translate(key: 'LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.xlf:audit.chain_valid')}" state="0">
1313
The audit log hash chain has been verified successfully. No tampering or modifications have been detected.
1414
</f:be.infobox>
1515
</f:then>
1616
<f:else>
17-
<f:be.infobox title="{f:translate(key: 'LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.xlf:audit.chain_invalid')}" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR')}">
17+
<f:be.infobox title="{f:translate(key: 'LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.xlf:audit.chain_invalid')}" state="2">
1818
Hash chain verification failed. The audit log may have been tampered with.
1919
</f:be.infobox>
2020

Resources/Private/Templates/Migration/Configure.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h2>Step 3: Configure Migration</h2>
2525
</p>
2626

2727
<form method="post" action="{f:be.uri(route: 'admin_vault_migration', parameters: '{action: \'execute\'}')}">
28-
<f:be.infobox title="Database Modification" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::WARNING')}">
28+
<f:be.infobox title="Database Modification" state="1">
2929
<strong>Warning:</strong> This will modify your database. Make sure you have a backup before proceeding.
3030
</f:be.infobox>
3131

Resources/Private/Templates/Migration/Index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h3 class="card-title">Known API Key Formats</h3>
7777
</div>
7878

7979
<!-- Important Notes -->
80-
<f:be.infobox title="Important Notes" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::WARNING')}">
80+
<f:be.infobox title="Important Notes" state="1">
8181
<ul class="mb-0">
8282
<li><strong>Backup first</strong> - Always create a database backup before running migrations.</li>
8383
<li><strong>Test environment</strong> - Run the scan on a test system first to review what will be detected.</li>
@@ -86,7 +86,7 @@ <h3 class="card-title">Known API Key Formats</h3>
8686
</ul>
8787
</f:be.infobox>
8888

89-
<f:be.infobox title="Configuration Secrets" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}">
89+
<f:be.infobox title="Configuration Secrets" state="-1">
9090
Configuration secrets (in <code>LocalConfiguration.php</code> or extension settings) are detected but must be migrated manually.
9191
Replace the value with <code>%vault(identifier)%</code> after storing the secret in the vault.
9292
</f:be.infobox>

Resources/Private/Templates/Migration/Review.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h2>Step 2: Review and Select Secrets</h2>
2828
<f:if condition="{secrets -> f:count()} > 0">
2929
<f:then>
3030
<form method="post" action="{f:be.uri(route: 'admin_vault_migration', parameters: '{action: \'configure\'}')}">
31-
<f:be.infobox title="Database Secrets Only" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}">
31+
<f:be.infobox title="Database Secrets Only" state="-1">
3232
Only database secrets can be migrated via this wizard.
3333
Configuration secrets need to be updated manually to use <code>%vault(identifier)%</code> references.
3434
</f:be.infobox>
@@ -124,7 +124,7 @@ <h2>Step 2: Review and Select Secrets</h2>
124124
</f:asset.script>
125125
</f:then>
126126
<f:else>
127-
<f:be.infobox title="No Database Secrets Found" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::WARNING')}">
127+
<f:be.infobox title="No Database Secrets Found" state="1">
128128
No database secrets were found to migrate. The scan may have detected only configuration secrets,
129129
which must be migrated manually by updating your configuration to use <code>%vault(identifier)%</code> references.
130130
</f:be.infobox>

Resources/Private/Templates/Migration/Scan.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ <h3>
149149
</f:if>
150150
</div>
151151
<f:if condition="{configCount} && !{databaseCount}">
152-
<f:be.infobox title="No Database Secrets to Migrate" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}">
152+
<f:be.infobox title="No Database Secrets to Migrate" state="-1">
153153
Only configuration secrets were detected. These must be migrated manually by updating your configuration
154154
to use <code>%vault(identifier)%</code> references. See the documentation for details.
155155
</f:be.infobox>
156156
</f:if>
157157
</f:then>
158158
<f:else>
159-
<f:be.infobox title="No Plaintext Secrets Detected" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::OK')}">
159+
<f:be.infobox title="No Plaintext Secrets Detected" state="0">
160160
Great! No potential plaintext secrets were found in your database or configuration.
161161
Your sensitive data appears to be properly protected.
162162
</f:be.infobox>

Resources/Private/Templates/Migration/Verify.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ <h2>Migration Details</h2>
9898
</div>
9999

100100
<f:if condition="{clearOriginals}">
101-
<f:be.infobox title="Database Updated" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}">
101+
<f:be.infobox title="Database Updated" state="-1">
102102
Original plaintext values have been replaced with vault identifiers in the database.
103103
</f:be.infobox>
104104
</f:if>

Resources/Private/Templates/Overview/Index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ <h3 class="card-title h5">
276276
</div>
277277

278278
<!-- Documentation Link -->
279-
<f:be.infobox title="Documentation" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}">
279+
<f:be.infobox title="Documentation" state="-1">
280280
For detailed information, see the
281281
<a href="https://docs.typo3.org/p/netresearch/nr-vault/main/en-us/" target="_blank" rel="noopener" class="text-decoration-underline">
282282
extension documentation

Resources/Private/Templates/Secrets/List.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ <h1><f:translate key="LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.
174174
</div>
175175
</f:then>
176176
<f:else>
177-
<f:be.infobox title="No Secrets Found" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}">
177+
<f:be.infobox title="No Secrets Found" state="-1">
178178
<f:translate key="LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.xlf:secrets.empty" />
179179
</f:be.infobox>
180180
</f:else>

0 commit comments

Comments
 (0)