• Resolved erictansh

    (@erictansh)


    $feed[‘meta’][‘groupList’] is string and $group->id is integer

    So the comparison operator is wrong. Need to add a break once the group id matches.

    Please change the code in

    
    foreach ( $results as $group ) {
    if ( $group->id === $feed['meta']['groupList'] ) {
    	$group_name = $group->name;
    } else {
    	$group_name = __( 'None', 'connector-gravityforms-mailerlite' );
    }}
    

    to

    
    foreach ( $results as $group ) {
    if ( $group->id == $feed['meta']['groupList'] ) {
    	$group_name = $group->name;
            break;
    } else {
    	$group_name = __( 'None', 'connector-gravityforms-mailerlite' );
    }}
    
    • This topic was modified 5 years, 1 month ago by erictansh.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author David Perez

    (@davidperez)

    Thanks for the fix, but why break?
    I should convert feed meta to integer then…

    Thread Starter erictansh

    (@erictansh)

    without the break, it will loop through the entire array. And if the last item of the array is not the matching group list, it will replace the $group_name with “None”.

    Plugin Author David Perez

    (@davidperez)

    Thanks! I’ll do it!

    Plugin Author David Perez

    (@davidperez)

    I’ve solved in next version 1.3.

    Thread Starter erictansh

    (@erictansh)

    Spotted a minor bug

    ‘tooltip’ => sprintf(‘
    <h6>%s</h6>%s’,
    esc_html__( ‘Group List’, ‘connector-gravityforms-mailerlite’ ),
    esc_html__( ‘Select the Mailer Lite list you would like to add your contacts to.’, ‘connector-gravityforms-mailerlite’ )
    ),

    • This reply was modified 5 years ago by erictansh.
    Thread Starter erictansh

    (@erictansh)

    missing s for %s

    and

    Contact List to Group List

    • This reply was modified 5 years ago by erictansh.
    Thread Starter erictansh

    (@erictansh)

    One more thing – you forget to add the “break” in the recent patch

    Plugin Author David Perez

    (@davidperez)

    Thanks! Applied for next version.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘GroupList column displayed as None’ is closed to new replies.