-
Notifications
You must be signed in to change notification settings - Fork 92
gpcc-copy-to-conditionally-hidden-fields.php
: Fixed an issue with copying to Multi Choice field.
#1137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…opying to Multi Choice field.
## Walkthrough
The change updates the logic for constructing target input IDs when copying values between multi-input source fields and conditionally hidden target fields. Instead of replacing the source field ID prefix, the new approach uses zero-based indexing to build target input IDs by concatenating the target field ID with a dot and a 1-based index, changing how source multi-input keys map to target keys.
## Changes
| Cohort / File(s) | Change Summary |
|-----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| **Target Input ID Construction Logic** <br> `gp-copy-cat/gpcc-copy-to-conditionally-hidden-fields.php` | Revised the iteration and string manipulation for mapping source multi-input values to target fields. The new method indexes source values numerically and constructs target input IDs by appending a dot and index to the target field ID, removing the previous prefix replacement approach. |
## Estimated code review effort
🎯 2 (Simple) | ⏱️ ~7 minutes
## Suggested reviewers
- veryspry Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
…opying to Multi Choice field.
Context
⛑️ Ticket(s): https://secure.helpscout.net/conversation/3005783710/86636
Summary
Issue with copying to Multi Choice field, explained by Samuel:
https://www.loom.com/share/2d8a3fc59ae044bfbdd064c8caa0d25f?sid=8820aa5d-01f9-4c3d-bb10-28bf9645cd82