Skip to content

Commit

Permalink
Fix non-debug version loaded for certain static resources when debug …
Browse files Browse the repository at this point in the history
…mode is enabled (OrchardCMS#16406)

Co-authored-by: Hisham Bin Ateya <hishamco_2007@yahoo.com>
  • Loading branch information
mdameer and hishamco committed Jul 7, 2024
1 parent 52dca20 commit 80ef1c7
Showing 1 changed file with 16 additions and 8 deletions.
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,7 @@ public RequireSettings()

public RequireSettings(ResourceManagementOptions options)
{
_options = options;
CdnMode = options.UseCdn;
DebugMode = options.DebugMode;
Culture = options.Culture;
Expand Down Expand Up @@ -258,14 +261,19 @@ 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();

settings.Name = Name;
settings.Type = Type;
settings.Location = Location;
settings.Position = Position;

return settings;
}

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

0 comments on commit 80ef1c7

Please sign in to comment.