Pro issue 5296 / stop decoding default values for non-array types#2121
Conversation
WalkthroughThe pull request introduces changes to the Changes
Possibly related PRs
Suggested reviewers
Warning Rate limit exceeded@Crabcyborg has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 59 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
classes/models/fields/FrmFieldType.php (1)
1657-1666: Update version placeholder and enhance documentation.The
@since x.xversion placeholder needs to be updated with the actual version number. Also, consider enhancing the documentation to clarify what the return value indicates.Apply this diff to improve the documentation:
/** * Only some field types should unserialize or decode values. This is based on the value of the array_allowed property. * * @since x.x + * + * @return bool True if the field value should be unserialized/decoded, false otherwise. */
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
classes/models/FrmField.php(1 hunks)classes/models/fields/FrmFieldType.php(1 hunks)
🔇 Additional comments (2)
classes/models/fields/FrmFieldType.php (1)
Line range hint 1668-1676: LGTM! Deprecation is handled correctly.
The deprecation of the misspelled method is properly implemented with:
- Clear deprecation notice and version
- Proper replacement method reference
- Backward compatibility maintained
classes/models/FrmField.php (1)
1087-1094: Conditional Unserialization of Default Values
The introduction of the conditional check if ( $field_object->should_unserialize_value() ) ensures that the default_value is only unserialized when appropriate for the field type. This prevents unnecessary or incorrect unserialization of default values for non-array field types, enhancing data integrity and performance.
Fixes https://github.com/Strategy11/formidable-pro/issues/5296