Skip to content

Change step setting back to text to support "any" string#2662

Merged
Crabcyborg merged 1 commit into
masterfrom
change_step_setting_back_to_text_to_support_any_string
Dec 16, 2025
Merged

Change step setting back to text to support "any" string#2662
Crabcyborg merged 1 commit into
masterfrom
change_step_setting_back_to_text_to_support_any_string

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

@coderabbitai

coderabbitai Bot commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The pull request modifies the Step field input in the number range form field configuration, changing its input type from number to text. This change enables support for non-numeric values like "any", with an explanatory comment added to document the rationale.

Changes

Cohort / File(s) Change summary
Number Range Step Field
classes/views/frm-fields/back-end/number-range.php
Changed Step input type from number to text to allow non-numeric values; added explanatory comment

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The pull request has no description provided by the author. Add a pull request description explaining the change, why it was needed, and any relevant context about supporting the 'any' value for the step setting.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: converting the step field input type from number to text to enable support for the 'any' string value.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch change_step_setting_back_to_text_to_support_any_string

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
classes/views/frm-fields/back-end/number-range.php (1)

29-32: Add pattern attribute for input validation.

Changing from type="number" to type="text" removes browser-level validation. While the step field lacks backend validation during save, invalid values are gracefully handled on frontend rendering (converted to the default value of 1). Adding a pattern attribute will improve admin experience by providing immediate feedback.

 	<?php
 	// Make sure to use type="text" for step because we also support "any" as a value.
 	?>
-	<input type="text" name="field_options[step_<?php echo absint( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['step'] ); ?>" id="frm_step_<?php echo esc_attr( $field['field_key'] ); ?>" />
+	<input type="text" name="field_options[step_<?php echo absint( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['step'] ); ?>" id="frm_step_<?php echo esc_attr( $field['field_key'] ); ?>" pattern="any|[0-9]+(\.[0-9]+)?" title="<?php esc_attr_e( 'Enter a number or &quot;any&quot;', 'formidable' ); ?>" />
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dca7bfe and c8a2b36.

📒 Files selected for processing (1)
  • classes/views/frm-fields/back-end/number-range.php (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Cypress
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: Cypress
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: PHP 8 tests in WP trunk

@Crabcyborg
Crabcyborg merged commit 67005e3 into master Dec 16, 2025
36 checks passed
@Crabcyborg
Crabcyborg deleted the change_step_setting_back_to_text_to_support_any_string branch December 16, 2025 17:21
stephywells pushed a commit that referenced this pull request Apr 4, 2026
…text_to_support_any_string

Change step setting back to text to support "any" string
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