Skip to content

fix: use integer values for f:be.infobox state for v13 compatibility#93

Merged
CybotTM merged 1 commit intomainfrom
fix/fluid-infobox-v13-compat
Mar 1, 2026
Merged

fix: use integer values for f:be.infobox state for v13 compatibility#93
CybotTM merged 1 commit intomainfrom
fix/fluid-infobox-v13-compat

Conversation

@CybotTM
Copy link
Member

@CybotTM CybotTM commented Mar 1, 2026

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

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 state attribute values for f:be.infobox view helpers. By directly using integer literals instead of enum constants, the application avoids runtime errors on v13 while maintaining functionality on v14, ensuring broader platform support for the extension's UI elements.

Highlights

  • TYPO3 v13 Compatibility Fix: Replaced ContextualFeedbackSeverity enum constants with their corresponding integer values in the state attribute of f:be.infobox Fluid view helper tags across multiple template files. This resolves 503 errors encountered on TYPO3 v13 due to type incompatibility, as v13 expects an int while v14 accepts mixed.
  • Standardized State Values: The integer values used are: INFO=-1, OK=0, WARNING=1, ERROR=2, ensuring consistent behavior across TYPO3 versions.
Changelog
  • Resources/Private/Templates/Audit/List.html
    • Updated f:be.infobox state from ContextualFeedbackSeverity::INFO to -1.
  • Resources/Private/Templates/Audit/VerifyChain.html
    • Updated f:be.infobox state from ContextualFeedbackSeverity::OK to 0.
    • Updated f:be.infobox state from ContextualFeedbackSeverity::ERROR to 2.
  • Resources/Private/Templates/Migration/Configure.html
    • Updated f:be.infobox state from ContextualFeedbackSeverity::WARNING to 1.
  • Resources/Private/Templates/Migration/Index.html
    • Updated f:be.infobox state from ContextualFeedbackSeverity::WARNING to 1.
    • Updated f:be.infobox state from ContextualFeedbackSeverity::INFO to -1.
  • Resources/Private/Templates/Migration/Review.html
    • Updated f:be.infobox state from ContextualFeedbackSeverity::INFO to -1.
    • Updated f:be.infobox state from ContextualFeedbackSeverity::WARNING to 1.
  • Resources/Private/Templates/Migration/Scan.html
    • Updated f:be.infobox state from ContextualFeedbackSeverity::INFO to -1.
    • Updated f:be.infobox state from ContextualFeedbackSeverity::OK to 0.
  • Resources/Private/Templates/Migration/Verify.html
    • Updated f:be.infobox state from ContextualFeedbackSeverity::INFO to -1.
  • Resources/Private/Templates/Overview/Index.html
    • Updated f:be.infobox state from ContextualFeedbackSeverity::INFO to -1.
  • Resources/Private/Templates/Secrets/List.html
    • Updated f:be.infobox state from ContextualFeedbackSeverity::INFO to -1.
Activity
  • No activity has been recorded yet for this pull request.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
<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}">

@CybotTM CybotTM enabled auto-merge March 1, 2026 10:17
@CybotTM CybotTM merged commit bb40585 into main Mar 1, 2026
130 of 132 checks passed
@CybotTM CybotTM deleted the fix/fluid-infobox-v13-compat branch March 1, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant