Sitecore WFFM 7.5 To 8 Upgrade Guide

This post is a follow on from, Upgrade Guide For Sitecore 7.5 to Sitecore 8.0. After upgrading Sitecore the next step is to upgrade any modules for your project. In today’s’ guide I’m going to cover my experiences upgrading Web Forms For Marketer to version 8.

Downloading And Installing The Update

The first thing you need to do is download the WFFm update, which you can download from here, specifically, this link.

To install the update, in your web browser, make sure you are logged into Sitecore, then go to this Url:

http://www.yourwebsite.com/sitecore/admin/UpdateInstallationWizard.aspx

When the upgrade wizard starts, click ‘Choose a package’.

sitecore_wffm_75_to_80_upgrade

From the ‘Choose a package to install’ page, select the update package, upload it and click ‘View package information’. Click ‘Analyze and install the package’, then ‘Install’. If everything goes to plan and WFFM installs without a hitch then you should be good. Unfortunately, in my experience, WFFM usually throws a few curve balls into the mix.

Errors Encountered

The first error I received when upgrading was:

sitecore_wffm_75_to_80_upgrade_1

Server Error in '/' Application.
Could not resolve type name: Sitecore.Forms.Mvc.Pipelines.InitializeSimpleInjectorContainer, Sitecore.Forms.Mvc (method: Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).
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.Exception: Could not resolve type name: Sitecore.Forms.Mvc.Pipelines.InitializeSimpleInjectorContainer, Sitecore.Forms.Mvc (method: Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).
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.

To troubleshoot this error meant one of several things:

  • Sitecore.Forms.Mvc.dll is missing from the solutions ‘bin’ folder
  • Sitecore.Forms.Mvc.dll hasn’t upgraded correctly and is using an older version
  • Sitecore.Forms.config wasn’t copied correctly

In this instance the Sitecore.Forms.config hadn’t copied correctly when I looked in my ‘App.Config’ -> ‘Include’, I realized I had forgotten to remove the .disabled I included to Sitecore.Forms.config, to upgrade Sitecore from 7.5 to 8.0. As I didn’t have the correct config file and my site wouldn’t load, I downloaded a copy of the WFF installation files, ‘WFFM 8.0 rev.141217 (Update-1)’, in the ‘files’ -> App_config’ -> ‘Include’ folder, copied all the config files into my webroot. This solved one issue and got me into the next one.

In the website, I was trying to upgrade used SimpleInjector for the IoC container. For some reason upgrade wizard deleted the Simple Injector assemblies from my project, which resulted in this error:

Server Error in '/' Application.
Could not load file or assembly 'SimpleInjector, Version=3.2.0.0, Culture=neutral, PublicKeyToken=984cb50dea722e99' or one of its dependencies. The system cannot find the file specified.
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.IO.FileNotFoundException: Could not load file or assembly 'SimpleInjector, Version=3.2.0.0, Culture=neutral, PublicKeyToken=984cb50dea722e99' or one of its dependencies. The system cannot find the file specified.
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.

Obviously, like a good boy I made a backup copy of my project before the upgrade, so I simply copied the assemblies from the back-up into the upgraded site.

sitecore_wffm_75_to_80_upgrade_4

Doing all of this I was able to get the upgrade to work. However, this is where I hit the proper difficulties…

Fixing WFFM

Every time I seem to upgrade WFFM it seems to be the hardest part of the upgrade process. I’m not sure if it’s me, or the sites I’ve worked on. Getting WFFM to submit a form correctly is usually where I bump into a random error, that has no obvious Google answer and requires several weeks of Sitecore support help. Sitecore support helped me out quite a lot, but I learnt several lessons:

  • You need to have analytics enabled from 8 onwards (you could get away with it being disabled in 7.5, but, 8 breaks if you don’t)

After running the upgrade wizard I tried to submit the sites contact us form. Doing this resulted in this error:

sitecore_75_8_wffm_error_1

Server Error in '/' Application.
Value cannot be null.
Parameter name: owner
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.ArgumentNullException: Value cannot be null.
Parameter name: owner
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: 
[ArgumentNullException: Value cannot be null. Parameter name: owner] Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName) +63 Sitecore.Diagnostics.Log.Warn(String message, Object owner) +54 Sitecore.WFFM.Core.Extensions.Warn.IsNull(Object obj, String name) +185 Sitecore.Form.Core.Ascx.Controls.SimpleForm.OnAddInitOnClient() +601 Sitecore.Form.Core.Ascx.Controls.SimpleForm.OnLoad(EventArgs e) +1110 Sitecore.Form.Web.UI.Controls.SitecoreSimpleForm.OnLoad(EventArgs e) +17 System.Web.UI.Control.LoadRecursive() +68 System.Web.UI.Control.LoadRecursive() +165 System.Web.UI.Control.LoadRecursive() +165 System.Web.UI.Control.LoadRecursive() +165 System.Web.UI.Control.LoadRecursive() +165 System.Web.UI.Control.LoadRecursive() +165 System.Web.UI.Control.LoadRecursive() +165 System.Web.UI.Control.LoadRecursive() +165 System.Web.UI.Control.LoadRecursive() +165 System.Web.UI.Control.LoadRecursive() +165 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4498

After logging a support ticket with Sitecore support, they told me that the issue was a bug. After a few weeks they provided me with this support assembly and these instructions:

1. Put the attached sitecore-support-428423 assembly in the bin folder
2. Modify the \sitecore modules\Web\Web Forms for Marketers\Control\SitecoreSimpleFormAscx.ascx file
replace

<%@ Control Language=”C#” AutoEventWireup=”true” CodeBehind=”SitecoreSimpleFormAscx.ascx.cs” Inherits=”Sitecore.Form.Web.UI.Controls.SitecoreSimpleFormAscx” %>

with

<%@ Control Language=”C#” AutoEventWireup=”true” CodeBehind=”SitecoreSimpleFormAscx.ascx.cs” Inherits=”Sitecore.Support.Form.Web.UI.Controls.SitecoreSimpleFormAscx,Sitecore.Support.428423″ %>

Doing this, resulted in my next error:

Message: Value cannot be null.
Parameter name: owner
Source: Sitecore.Kernel
at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName)
at Sitecore.Diagnostics.Log.Warn(String message, Object owner)
at Sitecore.WFFM.Core.Extensions.Warn.IsNull(Object obj, String name)
at Sitecore.WFFM.Analytics.AnalyticsTracker.GetCurrentContextPage(Nullable`1 index)
at Sitecore.WFFM.Analytics.AnalyticsTracker.TriggerEvent(ServerEvent data)
at Sitecore.Form.Core.Ascx.Controls.SimpleForm.UpdateSubmitAnalytics()
at Sitecore.Form.Core.Ascx.Controls.SimpleForm.OnClick(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
ManagedPoolThread #10 14:26:31 INFO  Job started: Sitecore.ListManagement.Analytics.UnlockContactListsAgent
ManagedPoolThread #10 14:26:31 INFO  Job ended: Sitecore.ListManagement.Analytics.UnlockContactListsAgent (units processed: )

As I was quite frustrated at this point, I simply got all the analytics config files from a blank Sitecore 8 instance and copied them into my project:

sitecore_75_8_wffm_error_3

Simply copying the config files over seemed to fix that issue. The next one was:

20508 10:11:18 ERROR Exception when executing agent aggregation/automationCleanupService
Exception: System.Exception
Message: Invalid object name 'Properties'.
Source: Sitecore.Kernel
at Sitecore.Data.DataProviders.Sql.DataProviderCommand.ExecuteReader()
at Sitecore.Data.DataProviders.Sql.DataProviderReader..ctor(DataProviderCommand command)
at Sitecore.Data.DataProviders.Sql.SqlDataApi.<>c__DisplayClass12.<CreateReader>b__10()
at Sitecore.Data.DataProviders.NullRetryer.Execute[T](Func`1 action, Action recover)
at Sitecore.Data.DataProviders.Sql.SqlDataApi.CreateReader(String sql, Object[] parameters)
at Sitecore.Analytics.Aggregation.SqlReportingStorageProviderProperties.GetProperties()
at Sitecore.Analytics.Aggregation.SqlReportingStorageProviderProperties.get_Item(String key)
at Sitecore.Analytics.Aggregation.SqlReportingStorageProviderProperties.GetCutoffDate()
at Sitecore.Analytics.Automation.Aggregation.Data.Processing.CleanupAgent.<Execute>b__0(IAggregatedAutomationStateStorageProvider r)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.Min[TSource](IEnumerable`1 source)
at Sitecore.Analytics.Automation.Aggregation.Data.Processing.CleanupAgent.Execute()
at Sitecore.Analytics.Core.BackgroundService.Run()

From past experience, this error was due to a scheme issue. I had run the WFFM upgrade DB SQLsuccessfully but to try and get the site up and running quickly, I pointed my ‘reporting’ in ‘ConnectionStrings.config’ in ‘App_config’ to a Sitecore_Analytics SQL database I had set-up using a clean 8.0 instance. This led me to the next error:

1020 12:26:56 WARN  Failure sending mail.
Exception: System.Net.Mail.SmtpException
Message: Failure sending mail.
Source: System
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Form.Core.Submit.SubmitActionManager.ExecuteSaving(ID formID, ControlResult[] list, ActionDefinition[] actions, Boolean simpleAdapt, ID sessionID)
Nested Exception
Exception: System.Net.WebException
Message: Unable to connect to the remote server
Source: System
at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6)
at System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback)
at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
Nested Exception
Exception: System.Net.Sockets.SocketException
Message: No connection could be made because the target machine actively refused it 127.0.0.1:25
Source: System
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
1020 12:26:56 WARN  The 'Send Email Message[id={D4502A11-9417-4479-9F2A-485F45D2E2D0}]' save action failed: We experienced a technical difficulty while processing your request. Your data may not have been correctly saved.
1020 12:26:56 WARN  Web Forms for Marketers: an exception: We experienced a technical difficulty while processing your request. Your data may not have been correctly saved. has occurred while trying to execute an action.
1020 12:26:56 INFO  Trace: aspx.page: End Raise PostBackEvent

This error was more reassuring. it seemed like in the upgrade process my SMTP details had been cleared from Sitecore save action item. To update the SMTP details, I opened the save item in ‘System’ -> ‘Modules’ -> ‘Settings’ -> ‘Action’ -> ‘Sae Actions’ -> ‘Send Email Message’. In the Properties tab, I added my SMTP details:

sitecore_75_8_wffm_error_2

After re-adding my SMTP details, I tried submitting the contact us form and it submitted correctly!

Jon D Jones

Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge

More Posts

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *