• Resolved bilmel

    (@bilmel)


    I updated the dropdown fields in the way you previously recommended, and all of the fields returned in the records. However, now every time I edit a record, the dropdown is blank, and if I save the record, the blank choice is saved in the database.

    I tried downloading the entire database to a CSV, repairing the fields that were blank, deleting the entire database, and then uploading the CSV again, but it didn’t address the problem.

    As another oddity, if I edit the field in question, selecting a valid dropdown, that gets saved into the record without any problem, and subsequent access to the record shows the field as edited.

    Just as a reminder, I changed the fields to look like this: Alaweo Pl::0, Alaweo St::1, Aulena Pl::2, Ehupua Pl::3, Ehupua St::4. Previously, they were “backwards” 0:: Alaweo Pl, etc.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author xnau webdesign

    (@xnau)

    It is normal to offer a “blank” option, if you don’t want that to be shown, you can configure that in your options with “null_select::false”

    Take a look at the documentation here: Null Select

    Thread Starter bilmel

    (@bilmel)

    I wasn’t clear; when you select a record for editing, with either the front or backend, instead of displaying the value already present in the drop down, it displays a blank field, and if you subsequently save the record, the blank selection overwrites the original value. Once you actually select the correct dropdown value and save it, it works normally.

    Mahalo

    Plugin Author xnau webdesign

    (@xnau)

    This means that the value in the record does not match one of the defined options for the dropdown.

    I suggest you open the database using phpMyAdmin, find the “wp_participants_database” table, then look at the column for your dropdown field. You will see all the stored values for that field in all the records. You can either correct the values in the database, or change the “options” setting for the dropdown so it matches what’s in the database.

    This is common problem when the options configuration of a selector field is changed after data has been saved previously.

    Thread Starter bilmel

    (@bilmel)

    I just looked at the database via phpmyadmin, and in each record the dropdown value appears to have the string, for example “Alaweo St” that belongs in the record.

    Likewise, the database fields table has all of the strings for each dropdown, with the same index values that were entered into the database fields portion of the plugin, ie Alaweo St::1

    The change I made previously to the database fields, at your suggestion, was from 1::Alaweo St to Alaweo St::1, etc for each field.

    If the value was stored in the record, and then mapped to the field name in the database field, I’d understand the confusion, but since the record contains the string corresponding to the chosen dropdown, I don’t understand why it displays correctly when viewing the record, but does not in the dropdown when editing the record.

    I can set you up with access to the database if you need it.

    Mahalo.

    Thread Starter bilmel

    (@bilmel)

    I just re-read the documentation, and perhaps I shouldn’t have a “::1” listed in the database fields, since that seems to be the method for creating Option Labels, while what I want is just the specific fields offered by the dropdown.

    Thread Starter bilmel

    (@bilmel)

    I tried removing the ::1 from the fields, and it didn’t make a difference with this problem.

    Plugin Author xnau webdesign

    (@xnau)

    Every time you change the “options” you will need to make sure that the stored data matches the options you have in there. If you go back to a plain list of options (not using the “::” any more) that’s fine, but you need to make sure that the values in the database exactly match the values in the option setting.

    Thread Starter bilmel

    (@bilmel)

    I removed all of the :: followed by number fields, and found a couple of places where the data describing the dropdown field was either incomplete, unused, or shown as lower case while the database text field was upper case. After doing this, I found one record that displayed “0” for its value, and changed it to a valid status.

    Now everything seems to be working!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Another problem with dropdowns’ is closed to new replies.