Change step setting back to text to support "any" string#2662
Conversation
WalkthroughThe pull request modifies the Step field input in the number range form field configuration, changing its input type from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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"totype="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 "any"', 'formidable' ); ?>" />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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
…text_to_support_any_string Change step setting back to text to support "any" string
Related ticket https://secure.helpscout.net/conversation/3172426676/244208
Pre-release
formidable-6.26.1b.zip