advanced-cms / advanced-reviews

This is an Open Source add-on that improves the reviewing process and lets external users to view & review content items or whole projects without the need to access the Edit Mode. Created and maintained by Bartosz Sekuła and Grzegorz Wiecheć
Apache License 2.0
17 stars 15 forks source link

external-review-component.js not loaded on external review pages #214

Closed anderslysne closed 2 years ago

anderslysne commented 2 years ago

Hello!

We have installed advanced reviews nuget package to our project, and we are having an issue with using the external review links, as we are getting 404 errors when trying to load .js and .cs files for adding comments etc. during external reviews.

When going to a review link, the javascript is being requested from https://<DOMAIN>/EPiServer/advanced-cms-external-reviews/ClientResources/external-review-component.js instead of https://<DOMAIN>/EPiServer/advanced-cms-external-reviews/1.1.0/ClientResources/external-review-component.js

When cloning the project and running it locally, these files are loaded normally. The problem occurs when referencing .dlls from the nuget package. I believe this behaviour might be cause by PageEditController:

private static string GetJsScriptPath()
        {
            const string url = "ClientResources/external-review-component.js";
            if (ModuleResourceResolver.Instance.TryResolvePath(typeof(PageEditController).Assembly, url,
                out var jsScriptPath))
            {
                return jsScriptPath;
            }

            return 
        }

Instead of ModuleResourceResolver.Instance.TryResolvePath, use ModuleResourceResolver.Instance.TryResolveClientPath, as this appends the nuget package version to the url path.

To reproduce:

Is it possible to get this fixed?

Thanks!

barteksekula commented 2 years ago

@anderslysne Thanks for that. I completely missed that during .net core migration. Fixed in 1.1.1 which will be live soon.

barteksekula commented 2 years ago

https://nuget.optimizely.com/package/?id=Advanced.CMS.AdvancedReviews&v=1.1.2