Skip to content

Conversation

@AbdiTolesa
Copy link
Contributor

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

Walkthrough

Modified order validation in FrmTransLiteListHelper::prepare_items to perform case-insensitive checking by normalizing the input with strtoupper() before validating against ['ASC', 'DESC'], with fallback to 'DESC' for invalid values.

Changes

Cohort / File(s) Change Summary
Order validation case-insensitivity
stripe/helpers/FrmTransLiteListHelper.php
Added strtoupper() normalization to order parameter validation in prepare_items method for case-insensitive comparison against ['ASC', 'DESC'], with 'DESC' fallback

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Straightforward validation logic improvement
  • Single-file change with minimal scope
  • No control-flow or structural modifications

Suggested labels

run analysis, run tests

Suggested reviewers

  • shervElmi

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Fix Payments list sorting issue" is directly related to the changeset, which modifies FrmTransLiteListHelper to make order validation case-insensitive, thereby fixing a sorting problem. The title is concise, clear, and accurately summarizes the main change without unnecessary noise or vagueness.
Description Check ✅ Passed The description references a specific GitHub issue that the changeset addresses, making it directly related to the changeset rather than off-topic. While the description is minimal and doesn't detail the implementation changes, the check is lenient and only requires the description to be related in some way to the changeset, which this clearly is.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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 issue-6070-fix_sorting_issue

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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)
stripe/helpers/FrmTransLiteListHelper.php (1)

46-49: Normalize the order value for consistency.

The fix correctly makes the validation case-insensitive, addressing the sorting issue. However, consider normalizing the $order variable to uppercase after validation for consistency throughout the codebase.

Apply this diff to normalize the value:

 $order   = FrmAppHelper::get_param( 'order', 'DESC', 'get', 'sanitize_text_field' );
+$order   = strtoupper( $order );
-if ( ! in_array( strtoupper( $order ), array( 'ASC', 'DESC' ), true ) ) {
+if ( ! in_array( $order, array( 'ASC', 'DESC' ), true ) ) {
 	$order = 'DESC';
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 567c163 and e833ca9.

📒 Files selected for processing (1)
  • stripe/helpers/FrmTransLiteListHelper.php (1 hunks)

Copy link
Contributor

@Crabcyborg Crabcyborg left a comment

Choose a reason for hiding this comment

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

Thanks @AbdiTolesa!

🚀

@Crabcyborg Crabcyborg added this to the 6.25.1 milestone Oct 28, 2025
@Crabcyborg Crabcyborg merged commit 0230bb7 into master Oct 28, 2025
24 checks passed
@Crabcyborg Crabcyborg deleted the issue-6070-fix_sorting_issue branch October 28, 2025 19:58
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.

3 participants