While creating address with phone number field, the phone number field under defaults is made mandatory, I believe this is incorrect.
The default value field should not be mandatory.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

    Comments

    gouli created an issue. See original summary.

    gouli’s picture

    StatusFileSize
    new1.42 KB

    I have removed the code which was forcing the phone number to be mandatory.
    The patch is attached.

    gouli’s picture

    StatusFileSize
    new721 bytes

    Ignore my previous patch. Use this one.

    gouli’s picture

    pelicani’s picture

    In addition to the required state of the field, the validation routine runs on it.
    Even if the phone number is blank, it will get validated and fail.

    We adjusted our file to check for the $telephone value.
    i.e.
    if (!empty($telephone)) {
    try {

    Not sure if that's what you would do, but wanted to mention this step to successfully remove the requirement.

    peace,
    michael

    takki’s picture

    StatusFileSize
    new1.15 KB

    Ok added this into the patch.

    pelicani’s picture

    Status: Active » Needs review

    Marking this for review to get into the module.

    peace,
    Michael

    brianwagner’s picture

    Reviewed #6. Works for me to prevent setting a default value.

    dishabhadra’s picture

    Status: Needs review » Needs work

    If we are applying the above patch, the below criteria not working.

    Steps:

    1. Mark the phone number field as required while creating the field.
    2. Create content and save the content without adding a phone number.
    3. It will save the content without giving any error for the phone number field.

    The field is required still no error. So above patch is failing when the phone number field is required.

    webengr’s picture

    this is still broke 9/28/2023 with latest versions.