Skip to content

Commit d4b0937

Browse files
committed
Merge remote-tracking branch 'origin/hotfix-19.1' into develop
2 parents fdcf760 + 887a53e commit d4b0937

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

Rock.Migrations/Migrations/Version 19.0/Version 19.0/202602101924214_RemoveLegacySystemEmailPagesBlocksEtc.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ in legacy migrations.
121121
Sql( @"
122122
DECLARE @SystemEmailGuid UNIQUEIDENTIFIER = '75CB0A4A-B1C5-4958-ADEB-8621BD231520';
123123
124-
-- Remove any other legacy records
125-
DELETE FROM [SystemEmail]
126-
WHERE [Guid] <> @SystemEmailGuid;
124+
-- Remove any other legacy records (We are commenting this out due to potential plugins that are still referencing records in this table)
125+
-- DELETE FROM [SystemEmail]
126+
-- WHERE [Guid] <> @SystemEmailGuid;
127127
128128
-- Update the retained compatibility record
129129
UPDATE [SystemEmail]
@@ -136,7 +136,7 @@ UPDATE [SystemEmail]
136136
Some RockShop plugins include legacy migrations that still reference this table. Dropping it could cause those plugins to fail during installation or upgrade. For that reason, the table has been intentionally retained out of an abundance of caution.
137137
138138
This table should be considered deprecated and will be removed in a future major version once compatibility concerns have been resolved.'
139-
WHERE [Guid] = @SystemEmailGuid;
139+
-- WHERE [Guid] = @SystemEmailGuid; NOTE: We are doing this for all remaining SystemEmail records.
140140
" );
141141

142142
// Remove the legacy EntityType and any associated Categories

Rock/Reporting/DataFilter/Person/InRegistrationInstanceFilter.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,6 @@ public override string GetSelectionFromObsidianComponentData( Type entityType, D
128128
var template = new RegistrationTemplateService( rockContext ).Get( templateGuid.Value );
129129
selectionConfig.RegistrationTemplateId = template.Id;
130130
}
131-
else
132-
{
133-
var template = new RegistrationTemplateService( rockContext ).Queryable().FirstOrDefault();
134-
selectionConfig.RegistrationTemplateId = template.Id;
135-
}
136131

137132
var instanceGuid = data.GetValueOrNull( "instance" )?.FromJsonOrNull<ListItemBag>()?.Value?.AsGuidOrNull();
138133
selectionConfig.RegistrationInstanceGuid = instanceGuid;
@@ -212,10 +207,14 @@ public override string FormatSelection( Type entityType, string selection )
212207
{
213208
return string.Format( "{0} in registration instance '{1}' {2}", filterOptions, registrationInstance.Name, waitlistFilterStatus );
214209
}
210+
else if ( registrationInstance == null && selectionConfig.RegistrationInstanceGuid.HasValue )
211+
{
212+
return string.Format( "{0} in registration instance '{1}' {2}", filterOptions, "[MISSING]", waitlistFilterStatus );
213+
}
215214
else
216215
{
217216
var registrationTemplate = new RegistrationTemplateService( new RockContext() ).Queryable().Where( t => t.Id == selectionConfig.RegistrationTemplateId ).FirstOrDefault();
218-
return string.Format( "{0} in any registration instance of template '{1}' {2}", filterOptions, registrationTemplate.Name, waitlistFilterStatus );
217+
return string.Format( "{0} in any registration instance of template '{1}' {2}", filterOptions, registrationTemplate?.Name ?? selectionConfig.RegistrationTemplateId + " [MISSING]", waitlistFilterStatus );
219218
}
220219
}
221220

@@ -244,6 +243,7 @@ public override Control[] CreateChildControls( Type entityType, FilterField filt
244243
} )
245244
.ToList();
246245
_ddlRegistrationTemplate.DataBind();
246+
_ddlRegistrationTemplate.Items.Insert( 0, new ListItem( string.Empty, string.Empty ) );
247247
_ddlRegistrationTemplate.SelectedIndexChanged += ddlRegistrationTemplate_SelectedIndexChanged;
248248
_ddlRegistrationTemplate.AutoPostBack = true;
249249
filterControl.Controls.Add( _ddlRegistrationTemplate );
@@ -373,6 +373,11 @@ public override void SetSelection( Type entityType, Control[] controls, string s
373373
{
374374
ddlRegistrationTemplate.SetValue( selectionConfig.RegistrationTemplateId );
375375
}
376+
else
377+
{
378+
ddlRegistrationTemplate.ClearSelection();
379+
ddlRegistrationTemplate.SelectedIndex = -1;
380+
}
376381

377382
ddlRegistrationTemplate_SelectedIndexChanged( ddlRegistrationTemplate, new EventArgs() );
378383

0 commit comments

Comments
 (0)