Skip to content

Named locations can be set as their own child #6669

@MicahO

Description

@MicahO

Description

In the Rock UI, a Named Location cannot be set as its own parent. However, it can be set as its own child. When this happens the entire tree disappears from the Locations list, which in turn means that the problem cannot be solved without resorting to SQL. This appears to be a wrinkle on a bug that was first noted (and fixed) back in 2015 (#1255).

Actual Behavior

Consider the following tree (built in the RockRMS sandbox on 1/27/26).

Image

We have a top-level item called "GitHub Example Top Location" and two child locations: "GH Sub-Location 1" and "GH Sub-Location 2". Now if we select the top location "GitHub Example Top Location" and set its parent to "GH Sub-Location 1" (its child location) it does not stop us. The save goes on in perpetuity and no error message is created.

Image

However, if we re-load the page and look for the location, we see that the entire tree disappears.

Image

The locations have not actually disappeared from the database, they just won't show in the tree. They can be found in SQL:

Image

Expected Behavior

We found this exact error in production (RocketChat thread), so it's not hypothetical. I'm open to the best, most elegant, or most Rock-like solution. But my take is the simplest solution is just to check when a location is being saved to make sure that it's not a part of its own tree.

Steps to Reproduce

See above (actual behavior) for the screenshots or to reproduce in the RockSolidChurchDEmo sandbox.

Issue Confirmation

  • Perform a search on the Github Issues to see if your bug is already reported.
  • Reproduced the problem on a fresh install or on the demo site.

Rock Version

Duplicated on our production site (17.6) and in the sandbox (18.1).

Client Culture Setting

en-US

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions