SparkDevNetwork/Rock

LocationTypeValueId not populated or incorrect when expanding from Group

jimmyhogoboom opened this issue · 2 comments

Description

Hello! I'm seeing some strange behavior which might be a bug. I hope I'm reporting this correctly and with enough information. Please let me know if I can provide any further details!

I noticed that LocationTypeValueId is missing or incorrect when queried via the /Groups endpoint. When querying via /GroupLocations directly, the GroupLocationTypeValueId is the expected value, and the correct value is also shown in the Rock UI.

Actual Behavior

Querying the /Groups endpoint using $expand of "GroupLocations/Location" and $select of "GroupLocations/Location" returns all address information, except the LocationTypeValueId is always null. Strangely enough, in my development installation, this value is actually always 19 ("Home" address) even when the address shows in Rock as "Previous".

When querying via /Groups

Screenshot 2024-08-20 at 4 02 41 PM

When querying via /GroupsLocations

Screenshot 2024-08-20 at 4 02 56 PM

Expected Behavior

Expected the LocationTypeValueId to match the address type shown in Rock or when querying via the /GroupLocations endpoint.

Steps to Reproduce

Screenshot 2024-08-20 at 4 14 52 PM
  • Scroll down and click the Edit button (pencil) on the "Decker Family"
Screenshot 2024-08-20 at 4 18 56 PM
  • Scroll down, add a new address with Type of "Previous" if it doesn't already exist
Screenshot 2024-08-20 at 4 20 02 PM Screenshot 2024-08-20 at 4 25 00 PM
  • Note that the value of "LocationTypeValueId" for both Locations is null.

Issue Confirmation

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

Rock Version

Rock McKinley 16.6 (1.16.6.9)

Client Culture Setting

en-US

@jimmyhogoboom Thanks for reaching out. I believe the value you’re looking for is the GroupLocationTypeValueId, which is included in the API results.

The UI currently is displaying the GroupLocationTypeValueId which is associated with the family’s GroupLocation. This ID is always populated when a Group is involved (e.g., Family, Small Group, etc.) with a Location (a GroupLocation).

On the other hand, only Named Locations such as Campuses, Buildings, and Rooms will have a value in the Locations LocationTypeValueId field.

Thank you for taking the time to look at this @chead4, I really appreciate it!

I apologize for my misunderstanding but especially for my hubris. I could have used the time I spent on this issue more deeply exploring the possibility of an error in my own code 😅