0 Comments

Image result for WFFM Sitecore

Have you ever seen “sitecore://web/{358B0E87-893A-45A8-A707-D19A32962DFF}?lang=en&ver=1” this value? If you are using WFFM with attachment field, you are most likely going to see this value in the Excel file downloaded from the form.  This is because WFFM doesn’t manipulate data during exporting data into Excel, which means data formatting will be the same as it’s stored in the database.  


Understand how it works

For solving the issue, let’s get understood how it works.  First of all, what’s the Guid in the URL?  It’s a media library item ID.  If you search the ID in Sitecore, you can find that item in media library.  The attachment will be created in Media Library Once the form is submitted.   By default,  it’s stored in Master database, however you are allowed to change to Web database with below settings.  In my case,  I don’t want to change this to store in web database, as the attachment is not mean to be accessible from public.    

<setting name="WFM.MasterDatabase" value="web" />

The attachment is just a media library item, which you use MediaManager.GetMediaUrl for getting the URL (As shown in screenshot below)

image


Solutions

Now, you should understand how it works, and let’s fix the export value together.  First of all, we need to find out which pipeline is for exporting the data into Excel. Luckily, It’s not so hard to find. It’s registered in the exportToExcel pipeline:

image

Next is to customize the ExportFormDataToExcel function, here is the code snippets

Finally, if you export data into Excel again, the wired URL is fixed with a valid media item URL!. 

0 Comments

image

Sitecore publishing service has been released since Sitecore 8.2.  The publishing service version 3.1 has been released for Sitecore 9 initial and update-1. The main objective for using the publish service is to make the publishing more efficiency and less impact on content editor.  Publishing service allows service resiliency and prevents the Publishing Service from being a single point of failure.


You can also configure the publishing service for high availability where multiple instances of the publishing service can be running and accessed via load balancer. only the active instance will have the publishing schedule enabled to process publish jobs. The inactive instances will be automatically elected as an active instance, if the active instance become unavailable.


There is no incremental license implications for enabling the Publishing service.  Nevertheless, It will increase the infrastructure costs i.e. a new dedicated server.  However, the performance would be improved massively – publishing 100K items can be completed within 10 mins.


Prerequisite

  • .NET Core  (Download from here)
  • Sitecore Publishing Service Package
  • Sitecore Publishing Module Package


Installing Steps

  • Create new site in IIS

image

  • Set .NET CLR version as NO Managed Code

image

  • Update connection string in sc.global.xml file

 image

  • Run Sitecore.Framework.Publishing.Host.exe schema upgrade - -force

image

  • Run [sitename]/api/publishing/operations/status. If it returns status:0, then it means the publishing service has been installed and running successfully.

image

  • Install Publishing service module in Sitecore. After installed the module, you can see the publishing icon in the dashboard.

image

Once you published item, you will be able to see the active jobs, and queued jobs in the dashboard as shown in below

image

0 Comments

 

I’m honoured to be invited as #Shehacks2018 mentor by Microsoft for supporting the local woman IT community.  It’s a great community with all talent people from different industries.  It’s my first time join the community as mentor. Not just sharing my experience and giving guidance, but also I learnt a lot from them during the 1.5 day event.   As part of the them, we came up with solution for a real issue by leveraging Machine Learn and cognitive services.  Our machine Learn and AI solution ultimately won the 3rd party integration with Machine Learning and AI Award! . Thanks AWS for the rewards.

clip_image002clip_image002[4]

0 Comments

Today I came across a publishing issue in our UAT environment.  After I clicked the publish, the publish popup window doesn’t display and in the console log it is showing an error  “because it set multiple X-Frame-Options” headers with conflicting values (‘SAMEORIGIN, Allow-From’…) Falling back to ‘deny’.” as shown below.

image

image

 

So, I checked the web.config file and noticed that someone added  “ALLOW-FORM” X-Frame-Option in web.config.

image

The error is because from sitecore 8.1 update 3 onwards sitecore introduce default module to add X-FRAME-OPTION Sameorigin using below module

<add type="Sitecore.Web.XFrameOptionsHeaderModule, Sitecore.Kernel" name="SitecoreXFrameOptionsHeaderModule" />

0 Comments

 

Recently, I’ve been working on Sitecore commerce project. In the post below, I’m going to share the experience about how I troubleshoot the issue and get it solved eventually.

Issue

The issue I encountered in creating a commerce user.  customerServiceProvider “createUser” throws an exception

An element with the specified key already exists., however the commerce user and sitecore user were successfully created. So WHY?

 

Troubleshooting

The initial suspicion was there are some duplications in the database. so I double checked UserObject table, the Addresses table (because I also add billing address and shipping address for the user), as well as the aspnet_Users table in Core database.   Unfortunately they all looks clean and right, no duplications.

Then I thought that maybe there are some other tables gets updated while creating a new user, so I opened the “SQL Server Profiler” tool trying to track all the database queries.  NO luck.

 

an-idea

Ultimately, I found the issue. it was because when delete a user in Sitecore, it does delete both commerce user and Sitecore user, BUT not contacts in xDB.  Just for the proof of concept, I removed the contact and identifier from xDB. Bingo! It fixed the issue.