Kentico / AzureStorageProvider

Replacement for standard Kentico EMS provider adding metadata caching support.
MIT License
5 stars 3 forks source link

Can't select template file name from Page Template definition dialog #6

Closed interestinglive closed 5 years ago

interestinglive commented 6 years ago

Brief bug description

In the "Select File" dialog when setting up an ASPX template the dialog doesn't show any files, just folders.

Repro steps

  1. Go to Page templates
  2. Select Blank ASPX -> Master page template
  3. Click Select in the File name dialog

select file

Expected behavior

We expect to be able to choose the local file.

ondrabus commented 6 years ago

Hi @interestinglive, can you please try the new package (uploaded just now) with up-to-date libraries? I can not reproduce this locally. Thanks.

interestinglive commented 6 years ago

I've tried and still have the same issues - any pointers on where I can look to troubleshoot?

ondrabus commented 6 years ago

Are you mapping the whole file system to Azure or just specific folders? You can enable logs in Settings -> System -> Debug and see in Event log which folders and files are listed from Azure.

interestinglive commented 6 years ago

I guess I'm just doing whatever is default in the DLL as I haven't changed it. How would I choose to only map a specific folder? Ah, sorry. Just read the comment properly. I'll check when I get back to my computer

ondrabus commented 6 years ago

It depends on what you want to achieve. If you want to keep using local file system for things like page templates, you need to map only specific folder to use Azure. Please take a look at instructions.docx, you will find all configuration options explained there.

interestinglive commented 6 years ago

Looks like it's doing the whole file system - Sorry about this, but I can't find any options in the instructions.docx for only mapping a particular folder through the config. Am I missing something?

An update, an example log entry, it seems to be processing things in App_Data even though I can see in the code that App_Data is set as an excluded path:

AzureStorageProvider | GetFiles D:\client\CMS\App_Data\CMSModules\WebAnalytics

For reference I'm in Kentico 11 - hotfix 33.

interestinglive commented 6 years ago

I think I've got a workaround for whatever is causing this locally - I've modified the OnInit of AzureStorageProviderModule to specify two providers - one the default Windows filesystem provider and the other specifically for the media library. Then it's working as I expected.

if (SettingsHelper.AppSettings[nameof(WebConfigKeys.CMSStorageProviderAssembly)] == "AzureStorageProvider")
            {
                var azureprovider = new StorageProvider("AzureStorageProvider", "AzureStorageProvider", true);
                StorageHelper.MapStoragePath(SettingsHelper.AppSettings["CMSAzureStorageRoot"], azureprovider);

                var provider = new StorageProvider(null, "CMS.FileSystemStorage", true);
                StorageHelper.MapStoragePath("/", provider);

            }

Thanks for the code - awesome

ondrabus commented 5 years ago

It's not possible to reproduce this issue on k12 provider, therefore closing.