logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
brant25348293  
#1 Posted : Sunday, September 18, 2022 2:20:48 PM(UTC)
brant25348293

Rank: Advanced Member

Groups: HelpDesk
Joined: 1/20/2020(UTC)
Posts: 43

After upgrading from 9.0.5 to 9.0.6 and performing the Post-Upgrade Instructions, I receive the Error "Value cannot be null or empty. Parameter name: contentPath" and this appears where the logo used to appear. After that, I noticed several errors in the server log. Then after 5 minutes or so, the site crashes completely. I double-checked the Post-Upgrade Instructions and this was performed exactly to the instructions.

This is the error from the log:

Exception: Value cannot be null or empty. Parameter name: contentPath Stack Trace: at System.Web.Mvc.UrlHelper.GenerateContentUrl(String contentPath, HttpContextBase httpContext) at ASP._Page_Themes_IDAutomation_Views_Shared__StoreLogo_cshtml.Execute() in C:\Data\www.idautomation.com\Themes\IDAutomation\Views\Shared\_StoreLogo.cshtml:line 3 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at System.Web.Mvc.Async.AsyncResultWrapper.<>c.<.cctor>b__15_0(IAsyncResult asyncResult, Action action) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass5_0.<Wrap>b__0() at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)


Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shaharyar  
#2 Posted : Monday, September 19, 2022 5:26:29 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Hi,

You are using customize view file in your custom theme folder. You need to merge the changes with our stock _StoreLogo.cshtml file.

To remove the error from existing file
1- Search for
Code:
ViewBag.ImageUrl

2- Replace with
Code:
Model.Logo.Url

3- Search for
Code:
ViewBag.MobileImageUrl

4- Replace with
Code:
Model.MobileImage.Url

5- Add
Code:
@model LogoModel
at the top of the file
brant25348293  
#3 Posted : Monday, September 19, 2022 10:13:41 AM(UTC)
brant25348293

Rank: Advanced Member

Groups: HelpDesk
Joined: 1/20/2020(UTC)
Posts: 43

Can you be a little more specific? What file do I merge with what other file?
I want to keep the same theme, so what do I do with my existing theme to make it compatible?
I did make a copy of a theme in the process and set it as the default - however, I do not want to use that theme.
I also do not want to have to change the theme on 1000+ webpages...
shaharyar  
#4 Posted : Tuesday, September 20, 2022 4:54:10 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Quote:
Can you be a little more specific? What file do I merge with what other file?


You need to merge
Code:
\Views\Shared\_StoreLogo.cshtml
with
Code:
\Themes\IDAutomation\Views\Shared\_StoreLogo.cshtml



Quote:
I want to keep the same theme, so what do I do with my existing theme to make it compatible?


You just need to merge the customized view files that are present in Themes\IDAutomation\Views folder.
brant25348293  
#5 Posted : Friday, November 25, 2022 12:34:51 PM(UTC)
brant25348293

Rank: Advanced Member

Groups: HelpDesk
Joined: 1/20/2020(UTC)
Posts: 43

It's still not working. Server crashes. Below are the contents of the two file you mention. Can you provide the contents of the new file I need to use from what I post here?


You said - You need to merge Code:
\Views\Shared\_StoreLogo.cshtml
This is the contents of that file:


@model LogoModel
@{
RequireScript("~/scripts/store_menu.js");
var basketItemsCount = AbleCommerce.Code.BasketHelper.GetBasketItemsCount();
}

<div id="store-logo-container" class="navbar-header">
<div id="storeLogo" class="storeLogo hidden-xs">
<a href="@Url.Content("~/")">
<img src="@Url.Content(Model.Logo.Url)" class="img-responsive" alt="@Model.AlternateText" width="@Model.Logo.Width" height="@Model.Logo.Height" />
</a>
</div>
<div class="store-logo-sm">
<a id="able-span" href="@Url.Content("~/")" class="visible-xs navbar-brand"><img src="@Url.Content(Model.MobileLogo.Url)" alt="@Model.MobileAlternateText" width="@Model.MobileLogo.Width" height="@Model.MobileLogo.Height" /></a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><i class="fa fa-bars"></i></button>
<a class="visible-xs pull-right navbar-brand" id="mobile-search-icon"><i class="fa fa-search m-t-n-xs"></i></a>
<a class="visible-xs pull-right navbar-brand" href="~/Checkout/Basket">
<span class="p1 fa-1x" data-count="@(basketItemsCount)">
<i class="fa fa-shopping-cart m-t-n-xs"></i>
</span>
</a>
</div>
</div>


with Code:
\Themes\IDAutomation\Views\Shared\_StoreLogo.cshtml
This is the contents of that file:

@{
RequireScript("~/scripts/store_menu.js");
var basketItemsCount = AbleCommerce.Code.BasketHelper.GetBasketItemsCount();
}

<div id="store-logo-container" class="navbar-header">
<div id="storeLogo" class="storeLogo hidden-xs">
<a href="@Url.Content("~/")">
<img src="@Url.Content(ViewBag.ImageUrl)" class="img-responsive" alt="@ViewBag.AlternateText" />
</a>
</div>
<div class="store-logo-sm">
<a id="able-span" href="@Url.Content("~/")" class="visible-xs navbar-brand"><img src="@Url.Content(ViewBag.MobileImageUrl)" alt="@ViewBag.MobileAlternateText" /></a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><i class="fa fa-bars"></i></button>
<a class="visible-xs pull-right navbar-brand" href="~/Checkout/Basket">
<span class="p1 fa-1x" data-count="@(basketItemsCount)">
<i class="fa fa-shopping-cart m-t-n-xs"></i>
</span>
</a>
</div>
</div>
Katie S  
#6 Posted : Monday, November 28, 2022 1:17:54 PM(UTC)
Katie S

Rank: Advanced Member

Groups: System, Administrators, Developers, Registered, HelpDesk
Joined: 10/29/2018(UTC)
Posts: 472

Thanks: 4 times
Was thanked: 34 time(s) in 33 post(s)
The file is custom, so I'm not sure why this is posted as a bug report. Have you tried making the individual changes that Shaharyar posted 2 months ago?

To remove the error from existing file
1- Search for
Code:
ViewBag.ImageUrl

2- Replace with
Code:
Model.Logo.Url

3- Search for
Code:
ViewBag.MobileImageUrl

4- Replace with
Code:
Model.MobileImage.Url

5- Add
Code:
@model LogoModel
Thanks for your support!

Katie
Secure eCommerce Software and Hosting
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.