CRM-6246 Deleting roles in Drupal removes associated Group in CiviCRM (if civicrm_group_roles is installed)

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.1.4
    • Fix Version/s: 3.2
    • Labels:
      None

      Description

      This patch will remove grous in CiviCRM when a Drupa role, that has been associated through the civicrm_group_roles module, has been deleted.

      Basically it's using hook_form_alter with a helper function

        Attachments

          Activity

          [CRM-6246] Deleting roles in Drupal removes associated Group in CiviCRM (if civicrm_group_roles is installed)
          Donald A. Lobo added a comment -


          thanx for the patch _

          Allen Shaw added a comment -

          Small problem with this line:
          + //change the order of the submits so we catch the changes before the form submits them
          + $form'#submit' = array_reverse($form'#submit');

          Using array_reverse() runs the risk of surprising other modules that may have added to $form'#submit'. Better to simply add '_civicrm_group_update' at the beginning of the array using array_unshift() – no?

          • $form'#submit'[] = '_civicrm_group_update';
            + array_unshift( $form'#submit', '_civicrm_group_update' );
            ...
          • //change the order of the submits so we catch the changes before the form submits them
          • $form'#submit' = array_reverse($form'#submit');

          (BTW, should I have made a new issue/patch for this?)

          Jim Taylor added a comment -

          Yea Allen's method is a better way to do it, and yea Allen it would be good to submit a patch as this is already patched

            People

            • Assignee:
              Donald A. Lobo
              Reporter:
              Jim Taylor

              Dates

              • Created:
                Updated:
                Resolved: