fix(integrations): normalize inbound option shape in configure view#4717
Merged
Conversation
…re view
class-integration.php injects incoming_metadata_fields.options as
[{value, label}] objects, but the Inbound section in configure-view
mapped them as if they were plain strings — so React got an object
as the key for every checkbox and rendered '[object Object]'
duplicates. Normalize each option to {value, label} (with bare-string
back-compat) before binding the key, label, and selection logic.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the Audience → Integrations “Configure” view rendering for inbound metadata field options by normalizing the inbound option shape before using it for React checkbox keys/labels and selection logic.
Changes:
- Normalize
incoming_metadata_fields.optionsentries to{ value, label }(while retaining bare-string backward compatibility). - Update checkbox
key,label,checked, andonChangebindings to use the normalized optionvalue/label.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Hey @miguelpeixe, good job getting this PR merged! 🎉 Now, the Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. Thank you! ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
class-integration.phpinjectsincoming_metadata_fields.optionsas[{value, label}]objects, but the Inbound section in configure-view mapped them as if they were plain strings — so React got an object as the key for every checkbox and rendered[object Object]duplicates.This PR normalizes each option to {value, label} (with bare-string back-compat) before binding the key, label, and selection logic.
How to test the changes in this Pull Request:
/admin.php?page=newspack-audience-integrations#/settings/espOther information: