Duplicating/Carbon Copy of site, Payment Methods erroring
Hi
I've created a carbon copy of one of our Tea Commerce sites, copied the DB and all files. This site will be a sister site of the original.
Everything works correctly as the main site it's copied from apart from the Payment Methods.
When I open the Payment methods I get :
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
TeaCommerce.Umbraco.Application.Views.PaymentMethods.EditPaymentMethod.lvSettings_ItemDataBound(Object sender, ListViewItemEventArgs e) +501
System.Web.UI.WebControls.ListView.OnItemDataBound(ListViewItemEventArgs e) +130
System.Web.UI.WebControls.ListView.CreateItemsWithoutGroups(ListViewPagedDataSource dataSource, Boolean dataBinding, InsertItemPosition insertPosition, ArrayList keyArray) +1255
System.Web.UI.WebControls.ListView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +1274
System.Web.UI.WebControls.ListView.PerformDataBinding(IEnumerable data) +52
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +207
System.Web.UI.WebControls.ListView.PerformSelect() +124
TeaCommerce.Umbraco.Application.Views.PaymentMethods.EditPaymentMethod.LoadPaymentMethodSettings() +532
TeaCommerce.Umbraco.Application.Views.PaymentMethods.EditPaymentMethod.OnLoad(EventArgs e) +739
System.Web.UI.Control.LoadRecursive() +89
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1606
Screenshot below:
Ive tried creating a new Payment Method, and it's still throwing the error.
Log file just says the same:
2020-03-27 15:31:47,073 [P41276/D7/T296] ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at TeaCommerce.Umbraco.Application.Views.PaymentMethods.EditPaymentMethod.lvSettings_ItemDataBound(Object sender, ListViewItemEventArgs e)
at System.Web.UI.WebControls.ListView.OnItemDataBound(ListViewItemEventArgs e)
at System.Web.UI.WebControls.ListView.CreateItemsWithoutGroups(ListViewPagedDataSource dataSource, Boolean dataBinding, InsertItemPosition insertPosition, ArrayList keyArray)
at System.Web.UI.WebControls.ListView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding)
at System.Web.UI.WebControls.ListView.PerformDataBinding(IEnumerable data)
at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
at System.Web.UI.WebControls.ListView.PerformSelect()
at TeaCommerce.Umbraco.Application.Views.PaymentMethods.EditPaymentMethod.LoadPaymentMethodSettings()
at TeaCommerce.Umbraco.Application.Views.PaymentMethods.EditPaymentMethod.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.app_plugins_teacommerce_views_paymentmethods_editpaymentmethod_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2020-03-27 15:32:13,617 [P41276/D7/T144] INFO umbraco.BusinessLogic.Log - Log scrubbed. Removed all items older than 2020-03-26 15:32:13
Hmm, it looks like it's to do with the payment provider settings. You may need to double check the [TeaCommerce_PaymentMethodSetting] table was copied ok.
Did you clone the DB? or duplicate it some other way? Is the sister site the same language etc? or has something changed between the two?
Yeh thought it could be the tables were not copied over, but looks to be there:
I just cloned the bacpac file, renamed it on import, all the tables seem to be there and they all have data in them.
The sister sites the same language. It just has less products in it, they are focusing on one particular genre of product, so we removed images and products, and just left the ones that are needed.
Do you think as the orders have been copied over, and some of the order contains links to deleted products it could cause it? like orphaning orders with a product?
I don't think so, the YSOD you posted shows it's having trouble binding the settings list to the ASP.NET list view, with something being null that it's not expecting to be
It could be the setting itself that is missing, or possibly any one of the controls it's expecting to find. Are you sure all the teacommerce views have been copied over? Have you set your file permissions on the site?
Duplicating/Carbon Copy of site, Payment Methods erroring
Hi
I've created a carbon copy of one of our Tea Commerce sites, copied the DB and all files. This site will be a sister site of the original.
Everything works correctly as the main site it's copied from apart from the Payment Methods.
When I open the Payment methods I get :
Screenshot below:
Ive tried creating a new Payment Method, and it's still throwing the error.
Log file just says the same:
Any ideas?
Hmm, it looks like it's to do with the payment provider settings. You may need to double check the [TeaCommerce_PaymentMethodSetting] table was copied ok.
Did you clone the DB? or duplicate it some other way? Is the sister site the same language etc? or has something changed between the two?
Yeh thought it could be the tables were not copied over, but looks to be there:
I just cloned the bacpac file, renamed it on import, all the tables seem to be there and they all have data in them.
The sister sites the same language. It just has less products in it, they are focusing on one particular genre of product, so we removed images and products, and just left the ones that are needed.
Do you think as the orders have been copied over, and some of the order contains links to deleted products it could cause it? like orphaning orders with a product?
I don't think so, the YSOD you posted shows it's having trouble binding the settings list to the ASP.NET list view, with something being null that it's not expecting to be
Something in here is null that it's not expecting to be null https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/blob/master/Source/TeaCommerce.Umbraco.Application/Views/PaymentMethods/EditPaymentMethod.aspx.cs#L354
It could be the setting itself that is missing, or possibly any one of the controls it's expecting to find. Are you sure all the teacommerce views have been copied over? Have you set your file permissions on the site?
Matt
Hi
So I checked everything I can and couldn't see any difference.
I decided to re-install Tea Commerce (change the installpackages.config) and that seems to have fixed it, all the settings are showing up.
I wonder if it has something to do with the licence set for the old site or some hash key that was set up to the old site?
Anyhow, it's all working as should now :) as always thanks for your help Matt, much appreciated.
Another TC website to Go Live Monday fingers crossed!
Hmmm, that is a strange one, but glad you got it working 👍
Next week is all about the project launches it seems 😉
is working on a reply...