View | Details | Raw Unified | Return to bug 41746
Collapse All | Expand All

(-)a/Koha/Devel/Sysprefs.pm (-2 / +11 lines)
Lines 137-142 sub add_new_pref { Link Here
137
    my @sysprefs;
137
    my @sysprefs;
138
    for my $line (@lines) {
138
    for my $line (@lines) {
139
        chomp $line;
139
        chomp $line;
140
        next if $line eq ';';    # Removing and adding it later
140
141
141
        # FIXME Explode if already exists?
142
        # FIXME Explode if already exists?
142
        my $syspref = $self->extract_syspref_from_line($line);
143
        my $syspref = $self->extract_syspref_from_line($line);
Lines 153-158 sub add_new_pref { Link Here
153
            $new_syspref->{type}
154
            $new_syspref->{type}
154
        )
155
        )
155
        };
156
        };
157
156
    @sysprefs = sort {
158
    @sysprefs = sort {
157
               defined $a->{variable}
159
               defined $a->{variable}
158
            && defined $b->{variable}
160
            && defined $b->{variable}
Lines 160-167 sub add_new_pref { Link Here
160
            cmp(
162
            cmp(
161
            lc( $b->{variable} ) =~
163
            lc( $b->{variable} ) =~
162
                s/_/ZZZ/gr )    # mysql sorts underscore last, if you modify this qa-test-tools will need adjustments
164
                s/_/ZZZ/gr )    # mysql sorts underscore last, if you modify this qa-test-tools will need adjustments
165
            || defined $a->{variable}
163
    } @sysprefs;
166
    } @sysprefs;
164
    write_file( $self->{filepath}, join( "\n", map { $_->{line} } @sysprefs ) );
167
168
    $sysprefs[-1]->{line} =~ s/,$//;
169
    if ( $sysprefs[-2]->{line} =~ /[^,]$/ ) {
170
        $sysprefs[-2]->{line} .= ',';
171
    }
172
    push @sysprefs, { line => ';' };
173
174
    write_file( $self->{filepath}, join( "\n", map { $_->{line} } @sysprefs ) . "\n" );
165
}
175
}
166
176
167
1;
177
1;
168
- 

Return to bug 41746