Title: Bug in user-forms.php
Last modified: August 30, 2016

---

# Bug in user-forms.php

 *  Resolved [duanestrong](https://wordpress.org/support/users/duanestrong/)
 * (@duanestrong)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/bug-in-user-formsphp/)
 * Hi Ryan
    I found a bug in user-forms.php. You only see this bug if you have edited
   mail lists and they are no longer in canonical index order in the array (one 
   or more has been unset) like i:0;i:0;i:1;i:1;i:2;i:4.
 * The problem is in function gm_user_profile_update(), near the end…
 *     ```
       // Loop Through Current Mailing List
       //foreach ($mailingListSubscriptions as $listId => $list) {
       foreach ($mailingListSubscriptions as $key => $listId) {
           if (!in_array($listId, $subscriptions)) {
               // Key doesnt exist, unsubscribe to this Mailing List
               gm_unsubscribe_user_list($listId, $userId);
           }
       }
       ```
   
 * You were using the array index as listId not the array value.
 * What happens next is the gm_unsubscribe_user_list() fails when it calls gm_get_mailing_list(
   $listId) because the listId is bad and it does die() (probably should be using
   wp_die(), or really not do a die but recover)
 * Hope this helps.
 * [https://wordpress.org/plugins/gnu-mailman-integration/](https://wordpress.org/plugins/gnu-mailman-integration/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Ryan Gyure](https://wordpress.org/support/users/rgyure/)
 * (@rgyure)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/bug-in-user-formsphp/#post-6755762)
 * Sorry for the delay in getting this fixed. I’ve done some work here to fix this
   issue so that if the user list is changed it will still keep the proper associations.
   Make sure to grab the 1.0.5 version just released.
 * If you continue to have issues, let me know.
 * Ryan
 *  [Iskren Antonov](https://wordpress.org/support/users/iskrenantonov/)
 * (@iskrenantonov)
 * [10 years ago](https://wordpress.org/support/topic/bug-in-user-formsphp/#post-6755769)
 * It is similar here:
 *     ```
       function gm_on_delete( $user_id ) {
       	foreach ( gm_get_user_subscriptions( $user_id ) as $list_id => $list ) {
       		// Unsubscribe User to List.
       		gm_unsubscribe_user_list( $list_id, $user_id );
       	}
       }
       ```
   
 * I think it should be:
    `gm_unsubscribe_user_list( $list, $user_id );` That is
   because _gm\_get\_user\_subscriptions_ returns numerically indexed array with
   list IDs. If I am right, please, fix this. If I am not, can you tell me how to
   fix this 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug in user-forms.php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gnu-mailman-integration.svg)
 * [GNU-Mailman Integration](https://wordpress.org/plugins/gnu-mailman-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gnu-mailman-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gnu-mailman-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/gnu-mailman-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gnu-mailman-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gnu-mailman-integration/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Iskren Antonov](https://wordpress.org/support/users/iskrenantonov/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/bug-in-user-formsphp/#post-6755769)
 * Status: resolved