Checkbox Field needs to be fixed!! Please!

This topic contains 12 replies, has 4 voices, and was last updated by  Stiofan O’Connor 9 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #16832

    identity
    Lifetime Member
    Post count: 445

    Related to my previous post

    I’ve setup the checkbox on a number of custom fields for things like “local business, kid friendly, wheelchair access, etc.”

    The problem I’ve found is that it is treated as a true/false situation, and if someone doesn’t select it, or forgets to select it, or in this case, I’m updating some pre-loaded listings which is causing these fields to now shift from a null state to a false state.

    So now I’m getting listings that are stating that they aren’t local, they aren’t kid friendly, and they aren’t wheelchair accessible. I also can’t “fix” this by checking the box on these as I don’t really know whether they are or they aren’t.

    As I mentioned in the linked post, they are already methods within the custom fields to create a either/or, true/false relationship, so the checkbox field should not be duplicating that. If checked, then the related message should show up. If not, then nothing should appear…not a “no”, “false”, etc., it simply “doesn’t exist” as a data point on the listing.

    Looking to go live this week, and this completely throws that off, or risk going live and getting angry business owners calling up to ask why they listing is stating they aren’t locally owned or wheelchair accessible when they are.

    cheers

    #16836

    Guust
    Moderator
    Post count: 29970

    I think you might be better off with a multi select, if you don’t want a yes/no answer.
    Have a look here:
    https://wpgeodirectory.com/support/topic/entering-checkbox-items

    That will print what is ticked, rather than stating whether something is ticked or not.

    #16855

    identity
    Lifetime Member
    Post count: 445

    Thanks Guust, but what I really want is the checkbox to work. It is clean and simple, doesn’t require having multiple answers/questions, and ideally, shouldn’t show up at all if nothing is checked. Or at least it should be.

    It’s basically acting as radio selector as it is today…if you don’t select yes, we’ll assume no…but not selecting anything isn’t the same as selecting no.

    At this point though, I don’t have much option but to rework these, which is made more painful as there are multiple instances across 11 CPTs. GD really needs a way to create and “apply” globally used fields across CPTs, rather than recreating this over and over again.

    cheers

    #16892

    identity
    Lifetime Member
    Post count: 445

    Not ideal, but looks like I can change these over to Multi-Select/checkboxes with a single option to get the result I’m looking for.

    Guust, could you or whoever else sees this ping Stiofan? What I’m wondering is if I could just go into phpMyAdmin, into the geodir_custom_fields table, figure out what the entry would look like for a Multi-Select/checkbox setting instead of Checkbox, and then make the edits there to convert the fields over?

    Otherwise, I will have to remove them all and re-add them all on in the WPGD admin, which I know will take several hours.

    Right now, time is not on my side, so I need to use the most cost effective approach I possibly can here.

    cheers

    #16919

    Guust
    Moderator
    Post count: 29970

    I had already alerted Stiofan, he might have missed it.
    I’ll give him another alert.

    #16951

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Brian,

    This is a good point and i agree, i will add it as a bug and update here when fixed.

    Thanks,

    Stiofan

    #16962

    identity
    Lifetime Member
    Post count: 445

    Stifoan,

    Thanks. Any chance that could be pushed out in the next day or two? Hoping to launch the site this week?

    cheers

    #16975

    Jeff
    Buyer
    Post count: 188

    Unfortunately that’s the way checkboxes work. They have 2 states, on and off.

    What you’re asking for is 3 states/options: Yes, No and “No Answer” which checkboxes don’t do. There are some custom checkboxes that do allow a “partial” state, but those are just masking some other functionality.

    #16981

    Jeff
    Buyer
    Post count: 188

    It should be possible to update this in the DB, but it’s a bit tricky for existing data.

    The geodir_custom_fields table is straightforward enough and with each row, you can edit it by hand, changing 3 fields it appears.

    1) data_type for select is empty (was VARCHAR for checkbox)
    2) field_type will now be “select” (no quotes)
    3) option_values will need your choices (No answer (or a blank), Yes, No)

    The trick is that the data in geodir_(post_type_name)_detail is a bit corrupted. Let’s deal with one generic column called “wheelchair” for wheelchair access, and our choices are “No Answer”, “Yes” and “No”.

    “No Answer” seems needed as you can’t create an empty entry in the select list that I can see.

    Right now, where you checked the box before, it has a 1 in the column “wheelchair” which is easy, because it means it is wheelchair accessible. So you can update all of those like (untested queries):

    UPDATE geodir_gd_place_detail SET geodir_wheelchair='Yes' WHERE geodir_wheelchair = '1';

    The problem comes with “no” or “no answer” because right now many of those are showing 0 for both cases – which is your original problem. You need to choose whether to leave those as “No” or make them all empty when you don’t know the correct value.

    Set all to “No”:

    UPDATE geodir_gd_place_detail SET geodir_wheelchair='No' WHERE geodir_wheelchair <> 'Yes';

    Clear all unknown:

    UPDATE geodir_gd_place_detail SET geodir_wheelchair=NULL WHERE geodir_wheelchair <> 'Yes';

    – this basically clears them. It’s not “No” and it’s not “No Answer” just empty or unanswered.

    Brian, You know how to reach me if you need help with this. I can also chat on Skype at jeff.rose1 if that’s better than email.

    #16995

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Brian,

    The dev i asigned this to has already fixed it so it will be in the next release, i am not sure how he fixed it yet though, if you want to email me i will send u a pre release version of core to test?

    Stiofan

    #16996

    Stiofan O’Connor
    Site Admin
    Post count: 22956
    This reply has been marked as private.
    #17064

    identity
    Lifetime Member
    Post count: 445

    Excellent, thanks Stiofan.

    And thanks for the response Jeff. Arguably, there is an on, off, and null state, just like zero is neither positive nor negative.

    In this case, I think it was less about on/off and more about presentation. If it is off, but no message is output in GD, I think that’s perfectly fine, after all, if I want or need an explicit on and off messaging, select and radio inputs are perfect for that.

    And perhaps that was the simple solution here…if off, then don’t display.

    Either way, greatly appreciate the quick turn around and I think this builds in improved messaging capabilities with regard to the custom fields.

    cheers

    #19041

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    This is resolved

Viewing 13 posts - 1 through 13 (of 13 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket