SparkDevNetwork / Rock

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

Group Member Requirements Grid fails to Export to Excel #5893

Closed cjfountain closed 3 months ago

cjfountain commented 4 months ago

Description

When trying to export the grid from the "Requirements" tab on a group viewer page, you get the error message. This happens on the demo site v16.2 and our production site v 16.4.

Actual Behavior

I get an error page with this code...

`NullReferenceException in App_Web_s4upujsv Message Object reference not set to an instance of an object.

Stack Trace

at RockWeb.Blocks.Groups.GroupMemberList.gGroupMemberRequirements_RowDataBound(Object sender, GridViewRowEventArgs e) at System.Web.UI.WebControls.GridView.OnRowDataBound(GridViewRowEventArgs e) at Rock.Web.UI.Controls.Grid.OnRowDataBound(GridViewRowEventArgs e) in \Rock\Web\UI\Controls\Grid\Grid.cs:line 1688 at System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) at System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) at Rock.Web.UI.Controls.Grid.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) in \Rock\Web\UI\Controls\Grid\Grid.cs:line 1395 at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at RockWeb.Blocks.Groups.GroupMemberList.BindGroupMemberRequirementsGrid(Boolean isExporting, Boolean isCommunication) at Rock.Web.UI.Controls.Grid.OnGridRebind(GridRebindEventArgs e) in \Rock\Web\UI\Controls\Grid\Grid.cs:line 4186 at Rock.Web.UI.Controls.Grid.RebindGrid(EventArgs e, Boolean disablePaging, Boolean isExporting, Boolean isCommunication) in \Rock\Web\UI\Controls\Grid\Grid.cs:line 2843 at Rock.Web.UI.Controls.Grid.Actions_ExcelExportClick(Object sender, EventArgs e) in \Rock\Web\UI\Controls\Grid\Grid.cs:line 2140 at Rock.Web.UI.Controls.GridActions.lbExcelExport_Click(Object sender, EventArgs e) in \Rock\Web\UI\Controls\Grid\GridActions.cs:line 694 at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boo`

Expected Behavior

I would expect a download window like what happens on the regular group member tab

Steps to Reproduce

Issue Confirmation

Rock Version

v16.2 (demo) and v 16.4 (my prod)

Client Culture Setting

en-US

Jon-Corey commented 3 months ago

We are also experiencing this issue in v15.1. This seems to be caused by the Requirements grid missing the Home Phone, Cell Phone, Home Address, Latitude, and Longitude fields. The gGroupMemberRequirements_RowDataBound() method tries to access these missing fields and thus throws that null reference exception.