5

Our servers' log files are filling up with [WFFM] CurrentSession is not initialized. The issue is due to the various events that are triggered when filling out a form: Field Complete, Error in Field Syntx, etc. These get triggered as XHR requests while a user is filling out the form and tabbing away from fields.

xDB is disabled in this instance, yet WFFM is still attempting to log these events.

1
  • Same issue I am facing. I disabled Xdb.Enabled as well as Xdb.Tracking.Enabled but still it is not working. Jan 23, 2018 at 2:57

2 Answers 2

5

You should ensure that Xdb.Tracking.Enabled is enabled:

<!--
  XDB TRACKING ENABLED
            Determines whether tracking is enabled or not.
            Default value: true

-->
<setting name="Xdb.Tracking.Enabled" value="true" />

It's entirely possible to set Xdb.Enabled=false whilst keeping the above setting enabled, the two are not required to be the same. Keeping tracking enabled allows "in-session" personalization to take place. You can read more in the official documentation or this other StackExchange answer.

I have not seen any official sources about WFFM and a requirement for Tracking to be enabled, but from experience have noted various issues with WFFM if this is disabled, including the warnings in the logs and the Rules section not being enabled on fields (it's possible to run Rules based personalization based on in-session even with Xdb being disabled, but in this case the related setting makes sense).

Additionally, the fix you have implemented is checking that Xdb.Tracking.Enabled is not set to true.

You could also disable Dropout Tracking. Select your form in the Content Editor, and then select Properties from the Forms tab:

Dropout Tracking

This should be disabled by default when you create the form when Xdb is disabled, but if you are packaging up items from another environment where Xdb is enabled then that could cause the xhr errors you are seeing. In an ideal situation, your environment architecture should be as similar as possible.

2
  • When Xdb.Tracking.Enabled is set to false it is not possible to open the Properties window (it is greyed out). Do you know where the value is stored or any other way to disable Dropout Tracking without first enabling Analytics again?
    – Rob
    Apr 5, 2018 at 12:18
  • @Rob You can delete everything from the Advanced > Tracking field in Content Editor, switch to Raw Values mode if necessary. BUT it is entirely possible to set Xdb.Tracking.Enabled=true and Xdb.Enabled=false without any issues (see here and here)
    – jammykam
    Apr 5, 2018 at 13:19
1

I pulled apart the DLLs that are responsible for these messages and it doesn't appear that any of these events check if xDB is disabled. The solution was to override the default WFFM logger:

public class CustomDefaultImplLogger : DefaultImplLogger
{
    private const string CurrentSession = "CurrentSession";

    public override bool IsNull(object obj, string name)
    {
        Assert.ArgumentNotNullOrEmpty(name, nameof(name));
        // only addition
        if (name == CurrentSession && !DependenciesManager.Settings.IsXdbTrackerEnabled)
            return true;

        if (obj != null)
            return false;
        Log($"{name}  is not initialized", this, LogMessageType.Warn);
        return true;
    }
}

And the patch:

<sitecore>
  <wffm>
    <logger type="Sitecore.Forms.Core.Dependencies.DefaultImplLogger, Sitecore.Forms.Core">
      <patch:attribute name="type">MyLogger.CustomDefaultImplLogger, MyLogger</patch:attribute>
    </logger>
  </wffm>
</sitecore>

This method will continue to work correctly once Analytics is later enabled as well.

2
  • 1
    Sent to support to confirm if it's a bug or if there IS a way to do it via configs that I missed.
    – jrap
    Nov 20, 2017 at 18:32
  • See @jammykam's response. This is solvable via configs.
    – jrap
    Nov 21, 2017 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.