SparkDevNetwork / Rock

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

Typescript error on Financial Batch Detail block #5906

Closed mattmarron closed 3 weeks ago

mattmarron commented 3 weeks ago

Description

After upgrading from 12 to 16.4, our header for the internal site was missing the "Personal Links" block.

This was causing an error message to appear where the block was:

Uncaught Error Cannot read properties of undefined (reading 'addQuickReturn')

I traced this back to Utility.js:2624, which does:

function addQuickReturn(title, section, sectionOrder) {
        window["Rock"].personalLinks.addQuickReturn(section, sectionOrder !== null && sectionOrder !== void 0 ? sectionOrder : 0, title);
      }

The issue looks to be that window["Rock"].personalLinks did not exist because we did not have the Personal Links block. In LavaFilters.cs, the following comment exists:

        /// <summary>
        /// Adds a QuickReturn to PersonalLinks.
        /// Note that this is only supported for pages that have the PersonalLinks block on it.
        /// </summary>
        /// <param name="input">The input.</param>
        /// <param name="typeName">Name of the type.</param>
        /// <param name="typeOrder">The type order.</param>
        public static void AddQuickReturn( string input, string typeName, int typeOrder = 0 )

So I added the Personal Links block to our header section and the error went away.

Actual Behavior

Financial Details Block should load even when Personal Links block doesn't exist.

Expected Behavior

Financial Details Block fails to load.

Steps to Reproduce

Issue Confirmation

Rock Version

16.5

Client Culture Setting

en-US