fix: use integer values for f:be.infobox state for v13 compatibility#93
fix: use integer values for f:be.infobox state for v13 compatibility#93
Conversation
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical compatibility issue with TYPO3 v13 by standardizing the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Automated approval for solo maintainer project
This PR has passed all automated quality gates:
- ✅ Static analysis (PHPStan)
- ✅ Code style (PHP-CS-Fixer)
- ✅ Unit & functional tests
- ✅ Security scanning
- ✅ Dependency review
See SECURITY_CONTROLS.md for compensating controls documentation.
There was a problem hiding this comment.
Code Review
This pull request addresses a compatibility issue with TYPO3 v13 by replacing ContextualFeedbackSeverity enum constants with their integer values in Fluid templates. While this fixes the issue, it introduces magic numbers into the templates. My review provides suggestions to improve maintainability by accessing the integer value from the enum constant directly (e.g., {...::INFO.value}), which is supported in TYPO3 v13+ and avoids hardcoding values. This approach retains the readability of using constants while ensuring compatibility.
| </f:then> | ||
| <f:else> | ||
| <f:be.infobox title="No Audit Entries" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}"> | ||
| <f:be.infobox title="No Audit Entries" state="-1"> |
There was a problem hiding this comment.
To improve maintainability and avoid using a magic number, you can access the integer value from the enum constant directly. This approach is compatible with TYPO3 v13+ and makes the code's intent clearer.
| <f:be.infobox title="No Audit Entries" state="-1"> | |
| <f:be.infobox title="No Audit Entries" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO').value}"> |
| <f:if condition="{valid}"> | ||
| <f:then> | ||
| <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')}"> | ||
| <f:be.infobox title="{f:translate(key: 'LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.xlf:audit.chain_valid')}" state="0"> |
There was a problem hiding this comment.
To improve maintainability and avoid using a magic number, you can access the integer value from the enum constant directly. This approach is compatible with TYPO3 v13+ and makes the code's intent clearer.
| <f:be.infobox title="{f:translate(key: 'LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.xlf:audit.chain_valid')}" state="0"> | |
| <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').value}"> |
| </f:then> | ||
| <f:else> | ||
| <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')}"> | ||
| <f:be.infobox title="{f:translate(key: 'LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.xlf:audit.chain_invalid')}" state="2"> |
There was a problem hiding this comment.
To improve maintainability and avoid using a magic number, you can access the integer value from the enum constant directly. This approach is compatible with TYPO3 v13+ and makes the code's intent clearer.
| <f:be.infobox title="{f:translate(key: 'LLL:EXT:nr_vault/Resources/Private/Language/locallang_mod.xlf:audit.chain_invalid')}" state="2"> | |
| <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').value}"> |
|
|
||
| <form method="post" action="{f:be.uri(route: 'admin_vault_migration', parameters: '{action: \'execute\'}')}"> | ||
| <f:be.infobox title="Database Modification" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::WARNING')}"> | ||
| <f:be.infobox title="Database Modification" state="1"> |
There was a problem hiding this comment.
To improve maintainability and avoid using a magic number, you can access the integer value from the enum constant directly. This approach is compatible with TYPO3 v13+ and makes the code's intent clearer.
| <f:be.infobox title="Database Modification" state="1"> | |
| <f:be.infobox title="Database Modification" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::WARNING').value}"> |
|
|
||
| <!-- Important Notes --> | ||
| <f:be.infobox title="Important Notes" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::WARNING')}"> | ||
| <f:be.infobox title="Important Notes" state="1"> |
There was a problem hiding this comment.
To improve maintainability and avoid using a magic number, you can access the integer value from the enum constant directly. This approach is compatible with TYPO3 v13+ and makes the code's intent clearer.
| <f:be.infobox title="Important Notes" state="1"> | |
| <f:be.infobox title="Important Notes" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::WARNING').value}"> |
| </div> | ||
| <f:if condition="{configCount} && !{databaseCount}"> | ||
| <f:be.infobox title="No Database Secrets to Migrate" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}"> | ||
| <f:be.infobox title="No Database Secrets to Migrate" state="-1"> |
There was a problem hiding this comment.
To improve maintainability and avoid using a magic number, you can access the integer value from the enum constant directly. This approach is compatible with TYPO3 v13+ and makes the code's intent clearer.
| <f:be.infobox title="No Database Secrets to Migrate" state="-1"> | |
| <f:be.infobox title="No Database Secrets to Migrate" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO').value}"> |
| </f:then> | ||
| <f:else> | ||
| <f:be.infobox title="No Plaintext Secrets Detected" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::OK')}"> | ||
| <f:be.infobox title="No Plaintext Secrets Detected" state="0"> |
There was a problem hiding this comment.
To improve maintainability and avoid using a magic number, you can access the integer value from the enum constant directly. This approach is compatible with TYPO3 v13+ and makes the code's intent clearer.
| <f:be.infobox title="No Plaintext Secrets Detected" state="0"> | |
| <f:be.infobox title="No Plaintext Secrets Detected" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::OK').value}"> |
|
|
||
| <f:if condition="{clearOriginals}"> | ||
| <f:be.infobox title="Database Updated" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}"> | ||
| <f:be.infobox title="Database Updated" state="-1"> |
There was a problem hiding this comment.
To improve maintainability and avoid using a magic number, you can access the integer value from the enum constant directly. This approach is compatible with TYPO3 v13+ and makes the code's intent clearer.
| <f:be.infobox title="Database Updated" state="-1"> | |
| <f:be.infobox title="Database Updated" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO').value}"> |
|
|
||
| <!-- Documentation Link --> | ||
| <f:be.infobox title="Documentation" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}"> | ||
| <f:be.infobox title="Documentation" state="-1"> |
There was a problem hiding this comment.
To improve maintainability and avoid using a magic number, you can access the integer value from the enum constant directly. This approach is compatible with TYPO3 v13+ and makes the code's intent clearer.
| <f:be.infobox title="Documentation" state="-1"> | |
| <f:be.infobox title="Documentation" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO').value}"> |
| </f:then> | ||
| <f:else> | ||
| <f:be.infobox title="No Secrets Found" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}"> | ||
| <f:be.infobox title="No Secrets Found" state="-1"> |
There was a problem hiding this comment.
To improve maintainability and avoid using a magic number, you can access the integer value from the enum constant directly. This approach is compatible with TYPO3 v13+ and makes the code's intent clearer.
| <f:be.infobox title="No Secrets Found" state="-1"> | |
| <f:be.infobox title="No Secrets Found" state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO').value}"> |
Summary
ContextualFeedbackSeverityenum constants with integer values inf:be.infoboxstateattributestateparameter is typed asintin TYPO3 v13 butmixedin v14; using the enum object causes 503 errors on v13Affected files