Saturday 9 September 2017

WFFM upgrade issue : List field values are empty in Form Designer

3 comments
Recently, I was involved in Sitecore upgrade project and encountered few issues. In this blog post, I am going to explain the issue related to WFFM module upgrade. 

Issue

We have upgraded to Sitecore 8.1 Update 3 CMS only mode and upgraded WFFM module as well. After upgradation, we are seeing an issue in WFFM form designer. The problem is related to WFFM Radio List field or Drop List field in Form Designer where we are no longer able to see the list items which were present there before the upgrade.  See below screenshot:


Radio List field or Drop List field related item data was saved in Parameters field as you can see from the below  screenshot:


I’ve tested this functionality on vanilla Sitecore 8.1 update 3 + WFFM instance. After my initial troubleshooting, it seems that Sitecore WFFM 8.1 is now using Localized Parameter field to display the items in Radio List field or Drop List field.


WFFM 8.1: Whenever we create new form item, Radio List field or Drop List field value gets stored in Parameters and Localized Parameter field. Radio List field or Drop List field is using Localized Parameters field to show those values in the Form Designer

I’ve reached out to Sitecore support team and they have registered this behavior as a bug in the current version of the WFFM module. To track the future status of this bug report, please use the reference number 75227.

Since WFFM 8.0 Localized Parameters are used for the purpose of localization. There is a specific piece of code which was supposed to be executed as post upgrade action, but was not invoked. This code was supposed to copy value from Parameters fields to Localized Parameters to keep this upgrade transition seamless. Since, this code did not execute, intended didn't happen and we have faced the issue. This behavior is not reproducible in WFFM 8.2.

Solution

  1. As a workaround, you can manually copy the value from the Parameters field to the Localized Parameters field in your Radio List field or Drop List field items that are located under form items.
  2. If you have many forms/fields you can ask Sitecore support to provide a script that you can run against your Sitecore instance which will copy the value from the Parameters field to the Localized Parameters field. You have to run the given .aspx page and enter the full path to the folder where your web forms are located (e.g. “/sitecore/system/Modules/Web Forms for Marketers/Website” or “/sitecore/system/Modules/Web Forms for Marketers/library”) to the textbox field. Click the “Update” button. This will updated web forms in master database.
    I’ve modified the support patch to meet our requirements:
    • Web forms are located at many different places in the Sitecore content tree. We have to find out full path for every web form and repeat the update process for every web form. This process seems cumbersome. Though it is possible to specify common root for all form items, given script is designed to work on items from specific templates only. But it will be more expensive to traverse whole tree compared to specific form folders. I’ve modified the script to find out all the referrers of form template (/sitecore/templates/Web Forms for Marketers/Form {FFB1DA32-2764-47DB-83B0-95B843546A7E}) using Sitecore link database. You can also use Sitecore Powershell Extensions to achieve same output.
    • We want to avoid publishing operation as it may publish unwanted or work in progress changes to web database and make those changes live. In this case, I’ve modified database name in the script to modify web form field items in web database as well. So, there will not be a need to publish these changes from master to web database. However, please ensure to run script on master as well so that any subsequent publish does not overwrite your changes in web database.
Comments and suggestions are most welcome. Happy coding!

3 comments :