OpenSanghaFoundation / OSF

Bug/Feature requests tracking and documentation managament
https://opensanghafoundation.org
0 stars 0 forks source link

Nowhere to specify a Buddhist Tradition when registering or updating the profile #40

Open coiby opened 1 month ago

coiby commented 1 month ago

Describe the bug

The Buddhist Tradition(s) field has a value "Other (please specify)" which indicates users can specify their own tradition if it's in the predefined list. But actually nowhere can users specify a custom tradition.

To Reproduce Steps to reproduce the behavior:

  1. Go to the Register page or edit the profile page
  2. Go to the "Buddhist Tradition(s)" field
  3. Choose the last item

Expected behavior To not confuse the users, we should either simply remove "(please specify)" from "Other (please specify)" or allow users to specify a custom tradition.

Screenshots

Screenshot_2024-05-25_07-33-07

OSFOSF commented 1 month ago

added field to reginstration page 9067 osf_spiritual_practices (other) and here is the code to add to fix the osf_buddhist_tradition array, but where to put this code so that the registration page 9067 will update the osf_buddhist_tradition? see short code [xyz-ics snippet="osf-spiritual-practices"]

<?php $cu = get_current_user(); if (isset ( $_POST['osf_spiritual_practices'];)){ $osp = $_POST['osf_spiritual_practices']; if (!empty($osp)) { // Get the existing array of 'osf_buddhist_tradition' from the user meta $osf_buddhist_tradition = get_user_meta($cu->ID, 'osf_buddhist_tradition', true); $osf_buddhist_tradition[] = $osp; update_user_meta($cu->ID, 'osf_buddhist_tradition', $osf_buddhist_tradition); } } ?>

OSFOSF commented 1 month ago

have now removed the option "Other (please specify)" because there is no way to use this option and thats all it s. so removed, but the other field still does not work in the screen shot notice the custom validation with a hook for the custom code in osf_spiritual_practices_hook Screenshot (2)

next notice the code in the themes maxcoach functions.php file Screenshot (4)

and then try to add data to the field and see that it does not update the Buddhist Traditions field

coiby commented 1 month ago

I think it's a good idea to simply remove "please specify" from "Other (please specify)" because it may cause trouble for the feature of searching meditation center or teacher. Personally, I don't think there is a need to use custom validation and I'll confirm it later.

nowmichaelclark commented 2 weeks ago

An easy way for users to notify us of other missing traditions from a UX perspective is for users to have that ability right in the form where they are entering their information. If we have to take a more manual approach then that's fine. We could have the users input other traditions/lineages in an empty text box and then those responses that get sent to us as a csv and we can decide which ones to add. This is just one idea though.