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
When querying via /GroupsLocations
Expected Behavior
Expected the LocationTypeValueId
to match the address type shown in Rock or when querying via the /GroupLocations endpoint.
Steps to Reproduce
- Go to https://rock.rocksolidchurchdemo.com/
- In the search bar, type "Ted Decker"
- Click the first person result
- Scroll down and click the Edit button (pencil) on the "Decker Family"
- Scroll down, add a new address with Type of "Previous" if it doesn't already exist
- Go to the Groups endpoint on the API page at https://rock.rocksolidchurchdemo.com/api/docs/index#!/Groups/GETapi_Groups
- Query with
$expand
and$select
values of "GroupLocations/Location" and$filter
value of "Id eq 68"
- 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 😅