Skip to content

Fix ActiveField::checkbox() and ActiveField::radio() label not rendered due to generateLabel() API change in Yii2 22.0. - #576

Merged
terabytesoftw merged 3 commits into
22from
fix/activefield-checkbox-radio-in-22
Aug 5, 2026
Merged

Fix ActiveField::checkbox() and ActiveField::radio() label not rendered due to generateLabel() API change in Yii2 22.0.#576
terabytesoftw merged 3 commits into
22from
fix/activefield-checkbox-radio-in-22

Conversation

@terabytesoftw

@terabytesoftw terabytesoftw commented Aug 5, 2026

Copy link
Copy Markdown
Member
Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Tests pass?

Summary by CodeRabbit

  • Bug Fixes
    • Fixed checkbox and radio field labels not appearing correctly after the Yii2 22.0 API update.
    • Checkbox and radio fields now automatically use the model’s attribute label when no label is provided.
    • Improved default label rendering while preserving existing Bootstrap styling and layout.

…ndered due to `generateLabel()` API change in Yii2 `22.0`.
@terabytesoftw

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment thread CHANGELOG.md Outdated
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

ActiveField::checkbox() and ActiveField::radio() now provide default label text and <label> options. CI workflows reuse ignore paths, use PostgreSQL 14, and target branch 22. The changelog documents the label-rendering fix.

Changes

Label rendering

Layer / File(s) Summary
ActiveField label defaults
src/components/ActiveField.php, CHANGELOG.md
Checkbox and radio fields now default to the model attribute label and effective <label> options. The changelog records the Yii2 22.0 generateLabel() fix.

CI workflow updates

Layer / File(s) Summary
Build workflow configuration
.github/workflows/build.yml
The build workflow reuses pull-request ignore paths for pushes, changes PostgreSQL from 9.6 to 14, and preserves the PHPUnit matrix and steps.
Zizmor branch filter
.github/workflows/zizmor.yml
The push branch filter changes from 22.0 to 22.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: samdark

Poem

A rabbit checks each label line,
While build paths align in time.
PostgreSQL hops to fourteen,
And branch twenty-two is seen.
Hop, hop—the workflows shine!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main bug fix in ActiveField checkbox and radio label rendering.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/activefield-checkbox-radio-in-22

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/ActiveField.php`:
- Around line 109-114: Update the label-options initialization in both
checkbox() sites at src/components/ActiveField.php lines 109-114 and 126-131 to
merge the default tag into the existing effective label options instead of
replacing them. Preserve form-check-label from $this->labelOptions while
ensuring the label tag defaults to label for both methods.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 00d7f374-4c9b-4e60-8811-c72eab8cf1cf

📥 Commits

Reviewing files that changed from the base of the PR and between 0ce5e3e and 8c9687e.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/components/ActiveField.php

Comment thread src/components/ActiveField.php Outdated
@terabytesoftw

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.36%. Comparing base (1385eca) to head (cc9b07d).
⚠️ Report is 15 commits behind head on 22.

Files with missing lines Patch % Lines
src/components/ActiveField.php 0.00% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                 22     #576      +/-   ##
============================================
- Coverage     46.93%   46.36%   -0.58%     
  Complexity      586      586              
============================================
  Files            45       45              
  Lines          2580     2532      -48     
============================================
- Hits           1211     1174      -37     
+ Misses         1369     1358      -11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build.yml:
- Around line 84-91: Update the Codecov action’s files input to reference the
coverage.clover output produced by the “Run unit tests with coverage” step, or
alternatively change PHPUnit’s coverage output to coverage.xml and keep the
existing input aligned with it. Ensure both steps use the same coverage
filename.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f7e0b77-48eb-4191-ab21-2dcc2b7db822

📥 Commits

Reviewing files that changed from the base of the PR and between 8c9687e and cc9b07d.

📒 Files selected for processing (4)
  • .github/workflows/build.yml
  • .github/workflows/zizmor.yml
  • CHANGELOG.md
  • src/components/ActiveField.php
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/ActiveField.php
  • CHANGELOG.md

Comment thread .github/workflows/build.yml
@terabytesoftw
terabytesoftw merged commit 0bcb18c into 22 Aug 5, 2026
11 of 13 checks passed
@terabytesoftw
terabytesoftw deleted the fix/activefield-checkbox-radio-in-22 branch August 5, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants