I am very disappointed and i need desperately your help. I am one step before going live and now the site is not working. To be more specific. I had create a custom section, trees and UmbracoAuthorized controllers. I am not using Angular, i am using Razor. Just before 7.2.2 everything was working fine. In backoffice when i was clicking an item in my custom tree items i was getting the edit page correctly throught the routing map.
routes.MapRoute( name: "TravelScanDefault", url: "App_Plugins/TravelScan/{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } );
All the files are under the App_Plugins/TravelScan/ folder.
And the controller is:
[PluginController("tsCities")] public class tsCitiesController : UmbracoAuthorizedController { public ActionResult Index(int id) { tsCity item = null; tsCityViewModel model = null;
//Get the current Umbraco Node ID var currentNodeId = UmbracoContext.PageId.HasValue ? UmbracoContext.PageId.Value : id;
var apiCntrl = new tsCitiesApiController(); item = apiCntrl.GetById(id);
model = new tsCityViewModel() { City = new tsCity(), GeoLocation = new PlaceViewModel() };
if (null != item) { model.City = item; if (!string.IsNullOrEmpty(item.Latitude) && !string.IsNullOrEmpty(item.Longitude)) { model.GeoLocation = new PlaceViewModel() { Pos = new GeoCoords() { Latitude = item.Latitude, Longitude = item.Longitude, Zoom = item.Zoom } }; } }
PopulateDDL(model);
// Create ViewBag Dynamic Properties for the Localized Detailed Descriptions foreach (var cultureName in model.Cultures) { ViewData.Add("DetailDesc_ResourceValue_" + cultureName, model.City.LocalizedDetailedDescription(cultureName)); }
After the upgrade to 7.2.4 i was testing the site in order to go live, i realize that all the backoffice custom razor edit pages are not working and i am getting the following error:
HTTP Error 401.0 - You must login to view this resource.
You do not have permission to view this directory or page.
I appreciate any suggestions or your help. I am desperate... i don't know how to fix it and the customer is waiting for the GoLive...
Sorry for the late bump, but I am running into the same issue and am wondering if anyone solved it? I can't find any documentation that outlines this stuff clearly anywhere.
It just needs to be routed through "umbraco/backoffice/Plugins/" but that points to the App_Plugins folder, which should be documented somewhere if someone with the power to do that sees this. :)
UmbracoAuthorizedController - Http Error 401.0
Hi,
I am very disappointed and i need desperately your help. I am one step before going live and now the site is not working. To be more specific. I had create a custom section, trees and UmbracoAuthorized controllers. I am not using Angular, i am using Razor. Just before 7.2.2 everything was working fine. In backoffice when i was clicking an item in my custom tree items i was getting the edit page correctly throught the routing map.
routes.MapRoute(
name: "TravelScanDefault",
url: "App_Plugins/TravelScan/{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
All the files are under the App_Plugins/TravelScan/ folder.
And the controller is:
[PluginController("tsCities")]
public class tsCitiesController : UmbracoAuthorizedController
{
public ActionResult Index(int id)
{
tsCity item = null;
tsCityViewModel model = null;
//Get the current Umbraco Node ID
var currentNodeId = UmbracoContext.PageId.HasValue ? UmbracoContext.PageId.Value : id;
var apiCntrl = new tsCitiesApiController();
item = apiCntrl.GetById(id);
model = new tsCityViewModel() { City = new tsCity(), GeoLocation = new PlaceViewModel() };
if (null != item)
{
model.City = item;
if (!string.IsNullOrEmpty(item.Latitude) && !string.IsNullOrEmpty(item.Longitude))
{
model.GeoLocation = new PlaceViewModel()
{
Pos = new GeoCoords()
{
Latitude = item.Latitude,
Longitude = item.Longitude,
Zoom = item.Zoom
}
};
}
}
PopulateDDL(model);
// Create ViewBag Dynamic Properties for the Localized Detailed Descriptions
foreach (var cultureName in model.Cultures)
{
ViewData.Add("DetailDesc_ResourceValue_" + cultureName, model.City.LocalizedDetailedDescription(cultureName));
}
return View("~/App_Plugins/TravelScan/BackOffice/Views/tsCities/Index.cshtml", model);
}
}
After the upgrade to 7.2.4 i was testing the site in order to go live, i realize that all the backoffice custom razor edit pages are not working and i am getting the following error:
HTTP Error 401.0 - You must login to view this resource.
You do not have permission to view this directory or page.
I appreciate any suggestions or your help. I am desperate... i don't know how to fix it and the customer is waiting for the GoLive...
Regards
Thomas
Sorry for the late bump, but I am running into the same issue and am wondering if anyone solved it? I can't find any documentation that outlines this stuff clearly anywhere.
Nevermind, just figured it out after tons and tons of trial and error.
Your route needs to be something like:
PluginFolder is in App_Plugins.
Then in your tree you need to do something like:
Your plugin folder looks like this:
PluginFolder
It just needs to be routed through "umbraco/backoffice/Plugins/" but that points to the App_Plugins folder, which should be documented somewhere if someone with the power to do that sees this. :)
Thanks Alex!
Just done an upgrade from Umbraco v6 to v7 and couldn't get our custom plugin to load.
Your solution fixed it for me :-)
is working on a reply...