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

Organization Address Appears as Named Location if it Shares an Address with a Named Location #1510

Closed JimMichael closed 12 months ago

JimMichael commented 8 years ago

We are seeing the following issue on 4.5:

  1. Create a campus (in our case "Chesterfield") and give it an address.
  2. Edit the Organization Address attribute to be the same address that you used in the campus
  3. After the Org Address is saved, instead of the full address it shows the NAME of the campus that has the same address: ![https://cloud.githubusercontent.com/assets/3903408/14900777/ddff04ea-0d57-11e6-9243-d3d03237b87d.png global attributes _ rock rms - mozilla firefox 2016-04-28 15 42 35]() Here you can see that the "address" is showing as "Chesterfield!" Originally it was just showing as "Chesterfield" per the steps above, but to prove that the Org Address is substituting the campus name for the address I added the ! to the campus name, and as you can see it changed in the org attribute accordingly.

Somehow when saving the Org Address Rock is seeing that we have a campus (location) with the same address and placing that campus name in the address attribute, wiping out the actual address. I have verified that entering an address that does NOT match a campus does not cause this issue.

azturner commented 8 years ago

Rock tries not to create multiple address(location) records with the same street address. This is to reduce standardization/geocoding costs. When you update a campus, Rock automatically adds/updates it's associated location record with the same name so that location will also show in the Named Locations list and allow you to add child buildings/rooms. When you set the global address to the same street address, instead of creating a duplicate location record, it uses the same location record used by the campus, and the address attribute's formatted value will first look to see if the location is named or not and if so, display the location's name (not the campus name). It's not actually "wiping" out the address, it's just displaying the name instead of the street address.

You'll notice too that when you update the campus name, the location name is getting updated too (see Named Location block).

It's really working as designed, but do you still feel there is a bug with that design, or is it causing an issue with the name being displayed somewhere instead of the street address?

JimMichael commented 8 years ago

Thanks for that detail, makes more sense now. However, I do now think the design is flawed. Where this issue surfaced for us is in the default email template, which inserts {{GlobalAttribute.OrganizationAddress}}, which in our case inserted the word "Chesterfield" instead of the (expected) actual address. Is this the intended use of this global attribute? I think any reasonable expectation of inserting that attribute into email is that it would expand to the actual agree address.

azturner commented 8 years ago

Yeah that would be a problem. We really can't just update the ToString() behavior of Location as that could affect other areas that expect a named location to resolve as the name. You can update that lava to {% assign orgAddress = 'Global' | Attribute:'OrganizationAddress','Object' %}{{ orgAddress.FormattedAddress }} to get the street address of a named location. Meanwhile, we'll look at how to best handle that in core.

JimMichael commented 6 years ago

I've honestly lost track of this issue, and I know I've asked before but don't recall the answer... is this also related to the way Check-in reports our Campus location as "114 N Eatherton Rd" instead of its name? (Chesterfield). We've been on check-in over a year and it still looks really odd to have it say "Jim was checked into 114 N Eatherton Rd, Chesterfield MO 63005" ;-)

TheArkChurch commented 1 year ago

@JimMichael is this still an issue or is it safe to close?

jonedmiston commented 12 months ago

@JimMichael I tried to reproduce this on pre-alpha and it looks like the behavior is not working as you'd like. Steps:

  1. Updated the Global Attribute for Address to a new address.
  2. This created a new record in the Locations table
  3. Added a new Named Location with this same address
  4. Noted that there is now two address in the Locations table (one named and the other not named)

Feel free to re-open with reproduction steps if you'd like.