Skip to content

Use safer field type check#3128

Merged
Crabcyborg merged 1 commit into
masterfrom
use_safer_field_type_check
Jun 8, 2026
Merged

Use safer field type check#3128
Crabcyborg merged 1 commit into
masterfrom
use_safer_field_type_check

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg commented Jun 8, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved alignment styling for checkbox and radio form fields.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 8, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 50534921-6492-4f44-9fc7-453e902f0e34

📥 Commits

Reviewing files that changed from the base of the PR and between ad59373 and a9daa8f.

📒 Files selected for processing (1)
  • classes/models/fields/FrmFieldType.php

📝 Walkthrough

Walkthrough

The change modifies how FrmFieldType::get_align_class_from_style_settings() determines the field type for alignment style lookup. Instead of calling FrmField::get_field_type(), it now uses explicit boolean logic to map the field directly to either checkbox or radio.

Changes

Alignment lookup for checkbox/radio fields

Layer / File(s) Summary
Checkbox vs radio field type mapping for style alignment
classes/models/fields/FrmFieldType.php
get_align_class_from_style_settings() now computes field type as explicit boolean mapping (checkbox if applicable, else radio) before calling get_align_key_for_style_settings, replacing the prior FrmField::get_field_type() call.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Alignment takes a clearer path,
Checkbox or radio—no mystery math!
Direct logic flows, no detours today,
Style settings found the simpler way.
hops contentedly

🚥 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 'Use safer field type check' directly describes the main change: replacing an unsafe field type check with a safer approach in the alignment lookup logic.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 use_safer_field_type_check

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 and usage tips.

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Jun 8, 2026

DeepSource Code Review

We reviewed changes in ad59373...a9daa8f on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Jun 8, 2026 2:06p.m. Review ↗
JavaScript Jun 8, 2026 2:06p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@Crabcyborg Crabcyborg merged commit 6b635af into master Jun 8, 2026
39 of 48 checks passed
@Crabcyborg Crabcyborg deleted the use_safer_field_type_check branch June 8, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant