Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-debug version loaded for certain static resources when debug mode is enabled #16406

Merged
merged 7 commits into from
Jul 7, 2024
Merged
Changes from 5 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 @@ -7,6 +7,8 @@ namespace OrchardCore.ResourceManagement
{
public class RequireSettings
{
private readonly ResourceManagementOptions _options;

private Dictionary<string, string> _attributes;

public string BasePath { get; set; }
Expand Down Expand Up @@ -36,6 +38,8 @@ public RequireSettings()

public RequireSettings(ResourceManagementOptions options)
{
_options = options;

mdameer marked this conversation as resolved.
Show resolved Hide resolved
CdnMode = options.UseCdn;
DebugMode = options.DebugMode;
Culture = options.Culture;
Expand Down Expand Up @@ -258,14 +262,17 @@ public RequireSettings CombinePosition(RequireSettings dependent)
return this;
}

public RequireSettings New() =>
new()
{
Name = Name,
Type = Type,
Location = Location,
Position = Position
};
public RequireSettings New()
{
RequireSettings settings = _options != null ? new(_options) : new();

mdameer marked this conversation as resolved.
Show resolved Hide resolved
settings.Name = Name;
settings.Type = Type;
settings.Location = Location;
settings.Position = Position;

return settings;
}

public RequireSettings NewAndCombine(RequireSettings other) =>
New().Combine(other);
Expand Down