Rock
Rock copied to clipboard
Family Attendance Badge (24 month chart) shows incorrect data when manually taking attendance for a group.
Description
When entering attendance manually for a child, the Family Attendance Badge for that child reports wildly incorrect data. This happens when adding attendance manually for a check-in group or for a regular group.
Today is November 7, 2019, so there has only been one week in November so far this year. I added one attendance entry for Noah Decker for this month, and two for the previous months. When looking at the badge though, his attendance is--literally--off the chart for November.
I tried the same thing with Alex Decker, but entered the attendance manually to the "Grades K-1"
check-in group. The attendance isn't off the chart this time, but November is higher than October, even though November has 1 entry and October has 2.
Steps to Reproduce
- In Group Viewer, select a group. Go to group Attendance.
- Click the plus sign to add a new attendance.
- Make sure the block settings for the Group Attendance Detail block has "Allow Adding Person" set to "Yes".
- Use the "Add New Attendee" to add a child to that attendance using a date in the current month. Save, then add more attendance entries in a previous month, and even further back if you wish.
- Look at the Family Attendance badge for that child and compare how it looks with the actual data you entered.
Expected behavior:
The bars in the graph should correspond with the data even if manually entered.
Actual behavior:
The bars are displaying differently than the data shows.
Versions
- Rock Version: 9.3 on demo. 9.4 on my church's rock.
- Client Culture Setting: en-US
@hillsideassembly I have not been able to reproduce this issue (even on the demo site or on an older v9.3 demo system).
That badge uses an underlying stored procedure to build the data for the chart and I'm wondering what you see when you ask for Noah Decker (ID 6 on my test system) data for the past 5 months like this:
DECLARE @RC int
DECLARE @PersonId int = 6
DECLARE @RoleGuid uniqueidentifier
DECLARE @ReferenceDate datetime
DECLARE @MonthCount int = 5
EXECUTE @RC = [dbo].[spCheckin_BadgeAttendance]
@PersonId
,@RoleGuid
,@ReferenceDate
,@MonthCount
I logged into the demo site today and noticed it is still occurring before I even did anything.
https://rock.rocksolidchurchdemo.com/Person/6/History
Someone renamed him to "Noah Smith" but it's the same person.
I see under his attendance history that he has been unusually active at Rock Solid Church, so maybe that's part of the issue.
I ran your query and surprisingly it didn't show that many check ins for him though.
I looked up a student in my church's rock (still running 9.4) and added a manual attendance for January. You'll notice on his chart that it looks like he's been more active in January (this month) than in December...
But that's not what his history says. It shows he attended once in January, twice in December, and twice in November. The chart should show the current month as smaller than the last two, and those two should be the same height.
Here is what his SQL query shows. I don't know why it says he attended 3 times in November, as you can see his history doesn't show that. Either way, it shows that January is only 1, so again, it should be the smallest bar.
Back to the demo site. Maddie Lowe didn't have any attendance entered recently, so I added a couple, one for December, one for January. Why aren't the bars the same height?
https://rock.rocksolidchurchdemo.com/Person/13/History
I'm not sure why you weren't able to reproduce these on the demo site. If you follow these steps, you should see that the bars on the badge aren't following the data correctly, especially for the current month, but also for the other months as well.
I've seen a bug in this code before that doesn't filter out attendance records that don't have "DidAttend" flagged. Not sure if that helps.
@hillsideassembly We discovered bad data on the Rock Demo site that prevents an accurate attendance badge chart. (We don't have a easy way to fix that bad data yet since the demo site is restored from image each night, but we will address that bad data in the future.)
Regarding the issue you're describing on your 9.x system:
The chart should show the current month as smaller than the last two, and those two should be the same height.
The way the system currently works is that it will only report how many Sundays have occurred since the start of the month. For example, if you're looking at September during the first week, it reports there being only 1 week (SundaysInMonth) in Sept as seen here:
So, that should be kept in mind when considering this issue since the bar shows the number as a percentage of the total number of Sunday's in the month.
That is currently by design (how it's always behaved).
However, there have been a few other bugs fixed since Rock v9.4 and we consider the original bug to be resolved.
If you encounter other bugs with the attendance badge bar in Rock v15.1 (or higher), please open another issue and provide data similar to what you've provided above.
Thanks for helping us make Rock better together!