Uploaded image for project: 'CiviVolunteer'
  1. CiviVolunteer
  2. VOL-309

Enabling CiviVolunteer returns "Expected one UFGroup but found 0", prevents further access to CiviCRM

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • Labels:
      None
    • Versioning Impact:
      None (no code merged)
    • Documentation Required?:
      None
    • Verified?:
      No

      Description

      After upgrading from 4.7.17 to 4.7.20, CiviVolunteer became disabled. Attempting to enable it resulted in a "Expected one UFGroup but found 0" message.

      After that, Civi remained inoperable with the message "The website encountered an unexpected error. Please try again later."

       

      Problem found to be due to an API3 call in org.civicrm.volunteer/settings/volunteer.setting.php line 23:

      civicrm_api3('UFGroup', 'getvalue', array(
          "name" => "volunteer_sign_up",
          "return" => "id"
      )))),

      It seems that during the update to 4.7.20, the name column of all records in civicrm_uf_group was appended with "_XX" where XX is the value of the id field (i.e. the id of the profile). A record having name = "volunteer_sign_up" is therefore not found.

      I'm not sure if appending the id to the name field in every record is a bug or a feature, and what other ramifications that might have, but as a workaround for this particular issue one could change the name parameter in the API call to:

      'name' => array('LIKE' => "volunteer_sign_up_%"),

      As there is a chance that this could match some other user profile, it would have been preferable to use a RegEx search for "volunteer_sign_up_[0-9]+", but RegEx is not currently supported by that API call.

      Another workaround is simply to edit the name field in the DB and return it to it's original value, but I'm concerned that violating what seems to be the new convention might have repercussions.

        Attachments

          Activity

            People

            • Assignee:
              pittstains Frank J. Gómez
              Reporter:
              bobs0 Bob Silvern
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: