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

GroupNesting Iterator skips sibling groups

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.5
    • Fix Version/s: 3.4.6
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      I couldn't find anywhere in core that actually uses the nesting iterator, but I noticed it not behaving correctly when I used it in a custom module.

      The purpose of the iterator is to list groups in order of the nesting tree, but the iterator does not check for siblings appropriately. For example, with a group structure like the following:

      Group 1
      – Group 1_1
      – – Group 1_1_1
      – Group 1_2 –
      – Group 1_3
      – – Group 1_3_1
      – – Group 1_3_2
      Group 2
      – Group 2_1
      – Group 2_2

      The iterator will actually put something like the following out, skipping sibling groups as it moves back up the tree.
      Group 1
      – Group 1_1
      – – Group 1_1_1
      Group 2
      – Group 2_1

      The attached patch should fix the issue. Also, why i was in there, I made the indent separator configurable, though it will still default to  -- 

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              adharris Andrew Harris
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: