﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
16562,sometimes deactivation of plugin deactivates another,Ghost_ufa,nacin,"in some cases of plugin's mailfunctions serialized list of active plugins has gaps in index - ex. 14 15 17 18
Current WP realisation don't correct it and can't work correctly, and occures deactivation of incorrect plugin.

resolution:

file wp-admin/includes/plugin.php
function deactivate_plugins

is:

{{{
                if ( $network_wide ) {
                        $do_network = true;
                        unset( $network_current[ $plugin ] );
                } else {
                        $key = array_search( $plugin, $current );
                        if ( false !== $key ) {
                                $do_blog = true;
                                array_splice( $current, $key, 1 );
                        }
                }
}}}

should be:
unset( $network_current[ $key ] ); 

instead of
array_splice( $current, $key, 1 );


And after loop, just before ""if ( $do_blog )"", add index renumbering like this:


{{{
        $i=0;       $new_current=array();
        foreach ( (array) $current as $cur ) $new_current[$i++]=$cur;
        $current=$new_current;

}}}


",defect (bug),closed,normal,3.5,General,3.1,major,fixed,has-patch,
