Skip to content
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

When a Mailchimp field is required in the Mailchimp account the merge field still displays "N" in the WP admin #102

Closed
1 task done
MaxwellGarceau opened this issue Jan 2, 2025 · 1 comment · Fixed by #109
Assignees
Labels
type:bug Something isn't working.
Milestone

Comments

@MaxwellGarceau
Copy link
Collaborator

Describe the bug

The "Required?" column in the Mailchimp admin should display "Y" when a merge tag is required. Instead, it always displays "N".

Mailchimp account
Screenshot 2025-01-01 at 11 49 04 PM

Mailchimp WP Admin
Screenshot 2025-01-01 at 11 49 40 PM

Note: The FE required labels are working

Steps to Reproduce

  1. Log into the test user Mailchimp account and set all of the merge fields to required
  2. Log into the WordPress site -> navigate to the Mailchimp settings page -> Click "Update List" to refresh the Mailchimp data
  3. Navigate down to the merge field tags section. All of the values in the "Required?" column will still be "N"

Screenshots, screen recording, code snippet

merge-field-required-label-does-not-appear-in-wp-admin.mov

Environment information

No response

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@MaxwellGarceau MaxwellGarceau added the type:bug Something isn't working. label Jan 2, 2025
@MaxwellGarceau
Copy link
Collaborator Author

Explanation for error

Caused in the views/setup_page.php file. The $mv_var['required'] field is a string. However, the strict equality check is failing because the comparison is with an int of 1.

<td><?php echo esc_html( ( 1 === $mv_var['required'] ) ? 'Y' : 'N' ); ?></td>

Solution

Fixed by add intval to $mv_var['required'].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
None yet
3 participants