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

Enabling Amazon S3 storage provider without configuration causes exception #15079

Closed
BenedekFarkas opened this issue Jan 12, 2024 · 4 comments
Closed
Labels
Milestone

Comments

@BenedekFarkas
Copy link
Member

Describe the bug

As the title says, the reason to change this is UX. Other, similar external providers give you a warning on their settings page about missing configuration instead.

To Reproduce

Steps to reproduce the behavior:

  1. Run OC on the latest main commit (8852c98 in my case).
  2. Set up the site with any recipe.
  3. Enable the Amazon Media Storage feature.
  4. Go to Configuration -> Media -> Amazon S3 Options

Expected behavior

I should see the configuration screen without errors, but with a notification that warns me about missing configuration.

Actual behavior

Instead, this error is thrown:

ArgumentNullException: Value cannot be null. (Parameter 'buffer')
Parlot.Scanner..ctor(string buffer)
Fluid.Parser.FluidParseContext..ctor(string text)
Fluid.FluidParserExtensions.Parse(FluidParser parser, string template)
OrchardCore.Media.AmazonS3.AwsStorageOptionsConfiguration.ParseBucketName(AwsStorageOptions options, TemplateContext templateContext) in AwsStorageOptionsConfiguration.cs
-
    private void ParseBucketName(AwsStorageOptions options, TemplateContext templateContext)
    {
        // Use Fluid directly as this is transient and cannot invoke _liquidTemplateManager.
        try
        {
            var template = _fluidParser.Parse(options.BucketName);
            options.BucketName = template
                .Render(templateContext, NullEncoder.Default)
                .Replace("\r", string.Empty)
                .Replace("\n", string.Empty)
                .Trim();
@hishamco
Copy link
Member

@neglectedvalue could you please check this while you are the one who worked on this module?

@neglectedvalue
Copy link
Contributor

Sure, I'll take a look, sorry for a long reply(caught a flu and was away from PC).

@hishamco
Copy link
Member

I see, hope you recover ASAP

@neglectedvalue
Copy link
Contributor

neglectedvalue commented Feb 9, 2024

Hi, i've made a small PR with fix for this issue #15293
Any comments\suggestions are welcomed.

@MikeAlhayek MikeAlhayek modified the milestones: 2.x, 2.0 Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants