SparkDevNetwork / Rock

An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
http://www.rockrms.com
572 stars 347 forks source link

Location Field Type Doesn't Save Named Locations within a Matrix Attribute #3693

Closed briankalwat closed 5 years ago

briankalwat commented 5 years ago

Prerequisites

Description

When trying to select a named location in a Location field type within a Matrix attribute, the value selected is not retained on save.

Steps to Reproduce

  1. Create an Attribute Matrix Template and add a "Location" attribute to it.
  2. Create a Matrix Attribute on the Campus entity (/page/193)
  3. Edit a campus and select a named location in a row of the matrix attribute.
  4. Save matrix attribute row.

image

Expected behavior:

Selected named location should be saved within the matrix row it was selected in.

Actual behavior:

Selected named location is not saved within the matrix row it was selected in.

Versions

nairdo commented 5 years ago

@briankalwat , I think I've replicated this issue, but want to verify you're seeing the same behavior. Does yours behave like this (after the first attempt to pick a named location fails, you choose Location and try a second time it then works): https://screencast-o-matic.com/embed?sc=cqhuo2TFQy&v=5&ff=1

briankalwat commented 5 years ago

@nairdo yes, that's exactly the behavior we were seeing.

ethan-sparkdevnetwork commented 5 years ago

For an immediate work-around you can click on the Location radio button (even though it is already selected) before selecting a named location.

ethan-sparkdevnetwork commented 5 years ago

The initial UI for the LocationPicker was showing Named location, but it was looking for an Address. Manually clicking the radio buttons would update the control and put them into agreement and it would work fine. I updated the LocationPicker to use Address as the default location picker.

Also added configuration options to the LocationPickerFieldType. "Available Location Types" will filter the location types for the picker. "Default Location Type" will specify the initial picker type to load. This will simplify location selection using the field type in most cases.