Log in | Register | Lost password

Bottom
boolean field and filters not quite as expected
  • Posted: 16.02.2004, 21:38
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    There is a roughly equal probability that I've overlooked something here but.....

    I have a template & plugin that is using a filterset to select a specific group of records. The task is to list members of a club by their position, but if they are also a commitee member then they get listed differently. The filter sets for the two are therefore:-
    Comittee members: "commitee:eq:1"
    Event organisers (role group 4) not on the commitee: "commitee:eq:0,role:sub:4"

    I was puzzled that the first part worked but the second didn't. Removing the commitee:eq:0 clause gets results but (obviously) then includes the commitee members as well.

    Setting "commitee:ne:1" seemed a logical next step, nope! that didn't work.

    I noticed that one of the events organisers appearing in the commitee list wasn't a commitee member, I'd accidentally ticked the box. So I went into admin and unticked it.

    Suddenly, this event coordinator appeared in the previously empty list???!!!!

    var_dumping the details gave an interesting result.
    Edited for brevity.
    The entry I had had to reset :-
    ["name"]=> string(11) "Dave Arnott"
    ["commitee"]=> string(1)

    An entry that was always correctly set as not on the commitee:-
    ["name"]=> string(13) "Charlie Thorn"
    [b]["commitee"]=> NULL


    So it would seem that boolean fields are uninitialsed unless explicitly ticked and then reset. So the question is...is this intentional (does it have a hidden benefit that I can't see)? Or a straightforward bug? Or better still do I need to go a get a shot of caffeine?

    Keep up the great work by the way.

    regards

    Neil
  • Posted: 16.02.2004, 21:41
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Looks much like a bug. I'll see what I can do. But it will take a few weeks before I come around this piece of code.
  • Posted: 16.02.2004, 23:03
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    No hurry, if I get a moment I'll try to find it and drop you a fix.
    As far as I can tell there is a simple workaround which means having two filter sets one working for commitee == 0 the other for commitee == NULL

    I have my basic overview page working now, though I need to do a some more CSS tidying and tweaking and then on to the next task.

Template courtesy of Designs By Darren.