Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ public IActionResult Index(string sourceUrl, string sourcePageTitle)
TaskRating = null,
};

if(sourcePageTitle == "Digital Learning Solutions - Page no longer available")
{
var url = ContentUrlHelper.ReplaceUrlSegment(sourceUrl);
_userFeedbackViewModel.SourceUrl = url;
_userFeedbackViewModel.SourcePageTitle = "Welcome";
}

if (_userFeedbackViewModel.UserId == null || _userFeedbackViewModel.UserId == 0)
{
return GuestFeedbackStart(_userFeedbackViewModel);
Expand Down
12 changes: 12 additions & 0 deletions DigitalLearningSolutions.Web/Helpers/ContentUrlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,17 @@ public static string GetContentPath(IConfiguration config, string videoPath)

public static string? GetNullableContentPath(IConfiguration config, string? videoPath) =>
videoPath != null ? GetContentPath(config, videoPath) : null;

public static string ReplaceUrlSegment(string sourceUrl)
{
string errorSegment = "LearningSolutions/StatusCode/410";
string welcomeSegment = "Home/Welcome";

if (sourceUrl.Contains(errorSegment))
{
return sourceUrl.Replace(errorSegment, welcomeSegment);
}
return sourceUrl;
}
}
}