#1 2018-02-02 01:53:19

van der Decken
Member
Registered: 2018-01-30
Posts: 27

[Patch] Upper limit on range comparison not restored

I noticed tonight that when I edited an advanced search conting a range comparison on a number field, the upper limit was being restored correctly. It was being set to the lower limit. I dug into the code a bit and discovered that in GCBasicWidgets.pm, the setValue function in the GCRange package was using $values[0] for both {from} and {to}, rather than $values[1] for {to}. I think that's an oops. I changed the last line to '$self->{to}->setValue($values[1]);' and that seems to have fixed the problem. A patch file is attached.

Code:

    sub setValue
    {
        my ($self, $value) = @_;
        my @values = split m/;/, $value;
        $self->{from}->setValue($values[0]);
        $self->{to}->setValue($values[0]);
    }

Attachments:
Attachment Icon range-comparison-fix.patch, Size: 419 bytes, Downloads: 48

Offline

 

#2 2018-02-07 12:25:01

kerenoc
Member
Registered: 2016-03-19
Posts: 217
Website

Re: [Patch] Upper limit on range comparison not restored

Thanks again (committed on GitLab) : it seems that you're exploring some seldom used corners of GCstar!

Online

 

#3 2018-02-08 02:20:42

van der Decken
Member
Registered: 2018-01-30
Posts: 27

Re: [Patch] Upper limit on range comparison not restored

I have to admit that I'm finding the filters to be very handy for looking at particular parts of a collection (a stamp collection in my case). So yes, I'm giving the filters (and the statistics) a bit of a workout!

Offline

 



Should you have a problem using GCstar, you can open a bug report or request some support on GCstar forums.