Admidio / admidio

Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.
https://www.admidio.org
GNU General Public License v2.0
336 stars 131 forks source link

Default Value for Profile Field causes profile to fail #1521

Closed Rvice closed 1 year ago

Rvice commented 1 year ago

Describe the bug Relating to "Deleted Entry" https://github.com/Admidio/admidio/issues/1516 I think I found the issue. I've crashed Playground with this user profile:

https://www.admidio.org/playground/adm_program/modules/profile/profile.php?user_uuid=565ca2dd-4618-4cba-9ce2-4865f50abed9

Note, I added "marital status" and there's a value I put in as "N/A"

I then had it set to default to N/A. Note, on initial setup of Marital Status, it did not allow default of N/A, but editing after it did.

When I registered the user, I did not set a value. As a result, it would default to N/A.

I assume this is an issue of the '/' character in the values.

To Reproduce Steps to reproduce the behavior:

  1. Go to Members (contacts in the playground)
  2. Click Edit Profile Fields
  3. Click Create Profile Field
    1. Give it whatever name and put it in the Basic Info category
    2. Data Type: Radio Button
    3. List Values:
      1. Single
      2. Married
      3. Widowed
      4. Divorced
      5. N/A
    4. Set Default Value: N/A
    5. Click Save: Observe it failed with "Profile field doesn't exists!"
    6. Click Back and remove "default value"
    7. Click Save - Observe it worked
  4. Go back and edit the profile field that was just created
    1. Edit the default value. Set it to N/A
    2. Click Save - Observe it worked
  5. Now create a new member (contact) and select nothing for the new field. Which would default the value to N/A

Expected behavior No error and to see the member/contact record.

Screenshots

System (please complete the following information):

Additional context Also posted on the forum https://www.admidio.org/forum/viewtopic.php?t=9769

Fasse commented 1 year ago

I have implemented better checks for the right value of the default value.

Rvice commented 1 year ago

No more "deleted entry" and "---" now works as an entry, thank you!