SparkDevNetwork / Rock

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

Line Chart Block Object Reference Error when used with Page Context Setting #5834

Closed KennySnow-BEMA closed 7 months ago

KennySnow-BEMA commented 7 months ago

Description

Using a Line Chart Block in v16.4 with the Page Context setting causes an Object Reference error preventing access to the page until the block is removed.

image

image

Actual Behavior

Using a Line Chart Block in v16.4 with the Page Context setting causes an Object Reference error preventing access to the page until the block is removed.

Error produced:

Error Object Reference not set to an instance of an object.

at Rock.Web.UI.RockPage.GetCurrentContext(EntityTypeCache entity, Dictionary`2 keyEntityDictionary) in \Rock\Web\UI\RockPage.cs:line 3116
   at Rock.Reporting.Dashboard.MetricChartDashboardWidget.GetPrimaryMetricPartitionEntityIdFromContext() in \Rock\Reporting\Dashboard\MetricChartDashboardWidget.cs:line 634
   at Rock.Reporting.Dashboard.MetricChartDashboardWidget.GetSelectedPartitionEntityIdentifiers() in \Rock\Reporting\Dashboard\MetricChartDashboardWidget.cs:line 555
   at RockWeb.Blocks.Reporting.Dashboard.LineChartDashboardWidget.OnLoadChart()
   at Rock.Reporting.Dashboard.MetricChartDashboardWidget.LoadChart() in \Rock\Reporting\Dashboard\MetricChartDashboardWidget.cs:line 769
   at Rock.Reporting.Dashboard.MetricChartDashboardWidget.OnLoad(EventArgs e) in \Rock\Reporting\Dashboard\MetricChartDashboardWidget.cs:line 182
   at Rock.Web.RockControlAdapter.OnLoad(EventArgs e) in \Rock\Web\RockControlAdapter.cs:line 71
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Expected Behavior

Either a generated chart or an error that page context is required for the block to function correctly.

Steps to Reproduce

On v16.4:

  1. On a page add a Line Chart block
  2. Select a metric
  3. Select "Get from page context"
  4. Save

Issue Confirmation

Rock Version

16.4

Client Culture Setting

en-Us

KennySnow-BEMA commented 7 months ago

The workaround for this appears to be to select "Select Partition(s)" and "Combine Multiple Values". If "Combine Multiple Values" is unchecked the block will report that it has no data.