Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-416

Pseudoconstant defaults not populated when editing CiviCRM Profile in Drupal's user account section

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      Description

      Although it's being displayed properly, when u edit, dropdowns with countries based on Custom Fields do not have defaults chosen.

      For reference, suspicious part of the code:

      CRM/UF/Form/Dynamic.php:

      function &setDefaultValues()
      {
      $defaults = array();

      if ( $this->_contact ) {
      foreach ( $this->_fields as $name => $field ) {
      $objName = $field['name'];
      if ( $objName == 'state_province_id' ) {
      $states =& CRM_Core_PseudoConstant::stateProvince( );
      if ( $this->_contact->state )

      { $defaults[$name] = array_search( $this->_contact->state, $states ); }

      } else if ( $objName == 'country_id' ) {
      $country =& CRM_Core_PseudoConstant::country( );
      if ( $this->_contact->country )

      { $defaults[$name] = array_search( $this->_contact->country, $country ); }

      [...]

      Will try to fix it tomorrow.

        Attachments

          Activity

            People

            • Assignee:
              mover Michał Mach
              Reporter:
              mover Michał Mach
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: