From e3b2709f7e2f307882c158ce2b9e7ea457897a60 Mon Sep 17 00:00:00 2001 From: Stephen Lee Date: Tue, 19 May 2026 16:55:29 -0400 Subject: [PATCH 1/4] ROCK-8438 Update obsolete code in CMS plugin blocks - CacheTagsCheckList: Get/SetUserPreference -> GetGlobalPersonPreferences().GetValue/SetValue + Save - ContactGroupLeaders: DefinedValueField/SMSFromDefinedValueId -> SystemPhoneNumberField/SmsFromSystemPhoneNumberId via SystemPhoneNumberCache - LoginStatus: Get/SetUserPreference -> GetGlobalPersonPreferences().GetValue/SetValue + Save Co-Authored-By: Claude Opus 4.7 --- .../org.secc.Cms/org_secc/Cms/CacheTagsCheckList.ascx.cs | 6 ++++-- .../org.secc.Cms/org_secc/Cms/ContactGroupLeaders.ascx.cs | 4 ++-- Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Plugins/org.secc.Cms/org_secc/Cms/CacheTagsCheckList.ascx.cs b/Plugins/org.secc.Cms/org_secc/Cms/CacheTagsCheckList.ascx.cs index d7db68a26..b8ccacbcb 100644 --- a/Plugins/org.secc.Cms/org_secc/Cms/CacheTagsCheckList.ascx.cs +++ b/Plugins/org.secc.Cms/org_secc/Cms/CacheTagsCheckList.ascx.cs @@ -150,12 +150,14 @@ protected void GetCacheTags() protected void Save() { - SetUserPreference( "checkbox-selected-values-preference", GetSelectedValues() ); + var preferences = GetGlobalPersonPreferences(); + preferences.SetValue( "checkbox-selected-values-preference", GetSelectedValues() ); + preferences.Save(); } protected void LoadPreferences() { - string usersselectedvalues = GetUserPreference( "checkbox-selected-values-preference" ); + string usersselectedvalues = GetGlobalPersonPreferences().GetValue( "checkbox-selected-values-preference" ); IEnumerable setvalues = usersselectedvalues.Split( ',' ).ToList(); cbl.SetValues( setvalues ); } diff --git a/Plugins/org.secc.Cms/org_secc/Cms/ContactGroupLeaders.ascx.cs b/Plugins/org.secc.Cms/org_secc/Cms/ContactGroupLeaders.ascx.cs index c10c29996..8e2ac6b52 100644 --- a/Plugins/org.secc.Cms/org_secc/Cms/ContactGroupLeaders.ascx.cs +++ b/Plugins/org.secc.Cms/org_secc/Cms/ContactGroupLeaders.ascx.cs @@ -54,7 +54,7 @@ namespace RockWeb.Plugins.org_secc.Cms [BooleanField( "Save Communication History", "Should a record of this communication be saved to the recipient's profile", false, "", 14 )] [LavaCommandsField( "Enabled Lava Commands", "The Lava commands that should be enabled for this HTML block.", false, order: 15 )] [BooleanField( "Enable SMS", "Enable messages being sent by SMS when it is the user's preferred communication method.", false, order: 16 )] - [DefinedValueField( "611bde1f-7405-4d16-8626-ccfedb0e62be", "SMS From Number", "The SMS Phone Number that the message should come from", false, false, "86604119-a222-4b35-9cd3-1a78db1b7b17", "", order: 17 )] + [SystemPhoneNumberField( "SMS From Number", "The SMS Phone Number that the message should come from", false, false, "86604119-a222-4b35-9cd3-1a78db1b7b17", "", order: 17 )] [CodeEditorField( "SMS Message Body", "The SMS message body.", CodeEditorMode.Lava, CodeEditorTheme.Rock, 200, false, "", "", 18 )] public partial class ContactGroupLeaders : Rock.Web.UI.RockBlock @@ -372,7 +372,7 @@ private void SendTextMessage( List smsRecipients, Dictionary Date: Tue, 19 May 2026 17:07:11 -0400 Subject: [PATCH 2/4] ROCK-8438 Update obsolete code in ChangeManager plugin blocks - ChangeRequests: Get/SetBlockUserPreference -> GetBlockPersonPreferences().GetValue/SetValue + Save Co-Authored-By: Claude Opus 4.7 --- .../org_secc/ChangeManager/ChangeRequests.ascx.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Plugins/org.secc.ChangeManager/org_secc/ChangeManager/ChangeRequests.ascx.cs b/Plugins/org.secc.ChangeManager/org_secc/ChangeManager/ChangeRequests.ascx.cs index d3a3c5822..dcd2bac84 100644 --- a/Plugins/org.secc.ChangeManager/org_secc/ChangeManager/ChangeRequests.ascx.cs +++ b/Plugins/org.secc.ChangeManager/org_secc/ChangeManager/ChangeRequests.ascx.cs @@ -61,8 +61,9 @@ protected override void OnLoad( EventArgs e ) pEntityType.IncludeGlobalOption = false; pEntityType.EntityTypes = entityTypes; - cbShowComplete.Checked = GetBlockUserPreference( "ShowComplete" ).AsBoolean(); - pEntityType.SelectedValue = GetBlockUserPreference( "EntityType" ); + var preferences = GetBlockPersonPreferences(); + cbShowComplete.Checked = preferences.GetValue( "ShowComplete" ).AsBoolean(); + pEntityType.SelectedValue = preferences.GetValue( "EntityType" ); BindGrid(); } @@ -133,8 +134,10 @@ protected void gRequests_RowSelected( object sender, Rock.Web.UI.Controls.RowEve protected void fRequests_ApplyFilterClick( object sender, EventArgs e ) { - SetBlockUserPreference( "ShowComplete", cbShowComplete.Checked.ToString() ); - SetBlockUserPreference( "EntityType", pEntityType.SelectedValue ); + var preferences = GetBlockPersonPreferences(); + preferences.SetValue( "ShowComplete", cbShowComplete.Checked.ToString() ); + preferences.SetValue( "EntityType", pEntityType.SelectedValue ); + preferences.Save(); BindGrid(); } From fd22f9e6831efc5c20d868d75c78dcd668f09af7 Mon Sep 17 00:00:00 2001 From: Stephen Lee Date: Tue, 19 May 2026 17:13:22 -0400 Subject: [PATCH 3/4] Use block preferences instead of global preferences Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs b/Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs index 9326f2835..7d64cc307 100644 --- a/Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs +++ b/Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs @@ -101,7 +101,7 @@ protected override void OnLoad( EventArgs e ) //Reset our clock when we look at our dashboard. if ( PageCache.Guid == GetAttributeValue( "MyDashboardPage" ).AsGuid() ) { - var preferences = GetGlobalPersonPreferences(); + var preferences = GetBlockPersonPreferences(); preferences.SetValue( "LastViewedDashboard", Rock.RockDateTime.Now.ToString() ); preferences.Save(); } From c0b87c770614f59415f90d1aba915b594b3a5e6f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 19 May 2026 21:15:21 +0000 Subject: [PATCH 4/4] fix: use GetBlockPersonPreferences() instead of GetGlobalPersonPreferences() in CacheTagsCheckList and LoginStatus Agent-Logs-Url: https://github.com/secc/RockPlugins/sessions/19e03026-da6f-4401-80af-67e012919c7c Co-authored-by: stphnlee <902855+stphnlee@users.noreply.github.com> --- Plugins/org.secc.Cms/org_secc/Cms/CacheTagsCheckList.ascx.cs | 4 ++-- Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/org.secc.Cms/org_secc/Cms/CacheTagsCheckList.ascx.cs b/Plugins/org.secc.Cms/org_secc/Cms/CacheTagsCheckList.ascx.cs index b8ccacbcb..b7c0b6947 100644 --- a/Plugins/org.secc.Cms/org_secc/Cms/CacheTagsCheckList.ascx.cs +++ b/Plugins/org.secc.Cms/org_secc/Cms/CacheTagsCheckList.ascx.cs @@ -150,14 +150,14 @@ protected void GetCacheTags() protected void Save() { - var preferences = GetGlobalPersonPreferences(); + var preferences = GetBlockPersonPreferences(); preferences.SetValue( "checkbox-selected-values-preference", GetSelectedValues() ); preferences.Save(); } protected void LoadPreferences() { - string usersselectedvalues = GetGlobalPersonPreferences().GetValue( "checkbox-selected-values-preference" ); + string usersselectedvalues = GetBlockPersonPreferences().GetValue( "checkbox-selected-values-preference" ); IEnumerable setvalues = usersselectedvalues.Split( ',' ).ToList(); cbl.SetValues( setvalues ); } diff --git a/Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs b/Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs index 7d64cc307..c3d3f3b57 100644 --- a/Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs +++ b/Plugins/org.secc.Cms/org_secc/Cms/LoginStatus.ascx.cs @@ -210,7 +210,7 @@ protected override void OnLoad( EventArgs e ) private int GetNotificationCount() { - var lastChecked = GetGlobalPersonPreferences().GetValue( "LastViewedDashboard" ).AsDateTime(); + var lastChecked = GetBlockPersonPreferences().GetValue( "LastViewedDashboard" ).AsDateTime(); if ( !lastChecked.HasValue ) { lastChecked = RockDateTime.Now.AddMonths( -3 );