Thursday, 12 January 2017

WebAPI - error message "An error has occurred."

If you get the following error message when using WebAPI:

{ "message": "An error has occurred." }  

Try setting CustomErrors mode="Off" in your web.config.  For some reason when CustomErrors are turned on, the error message is replaced with the above message.

See the following for more info:

http://stackoverflow.com/questions/13020103/webapis-messagean-error-has-occurred-on-iis7-not-in-iis-express

Tuesday, 6 December 2016

Firebug Stopped working!

I rely on Firebug as a Firefox add-in and was seriously dismayed when I installed Firefox 50 to find that Firebug had stopped working.  I believe that this is because from version 50 Firefox is multi-process.

Anyway I found a little work-around that gets Firebug working again.  Install Firequery after you upgrade to Firefox 50 and Firebug will start working again. Simple!

http://firequery.binaryage.com/

Monday, 28 November 2016

Chrome Extension for Testing GeoIP

Recently I've been working on a project that used GeoIP.  In particular the site has a location finder map, that uses your location as a starting point.  

Not being able to test different locations was an issue for me.  And then we were asked to develop some personalization that used the State/Region value obtained via GeoIP! 

How do you easily test for different scenarios, and more importantly how would the end user do effective UAT?

Whilst doing some research into the issue I came across the following chrome browser plug-in. It solves the problem by allowing you to override the appropriate browser data that contains the IP address value and trick the GeoIP detection into thinking you are somewhere you are not.  In effect spoofing an IP Address.

Here's a link to the tool:

https://chrome.google.com/webstore/detail/sitecore-analytics-testin/pecalkbdlhhhcoenmcjnmhgnncnkdgak?utm_source=chrome-app-launcher-info-dialog

Once installed you will see a Sitecore logo top-right.  Click on the logo and under GeoIP you will see the name of the selected profile - Default is the one set up for you on install.



Click on drop-down arrow to the right of the Default text, and select Manage Profiles. 


Here you can then add new profiles.  In the text boxes give it a name and enter the appropriate external IP address and click the Add Profile button:





Now open a new tab and navigate to your Sitecore site, click on the Sitecore logo and select the profile you want to use and then select New Contact. The page will refresh and your IP address will be changed to the selected one.

N.B. One point to note is that in order for this to work, you will need to update the Analytics.ForwardedRequestHttpHeader value in
Sitecore.Analytics.Tracking.config file.  You should use whatever value you have configured in the GeoIP settings in the tool:






Typical choices are X-Forwarded-For or X-Real-IP.

Note that the instructions supplied in the GeoIP settings section are wrong for Sitecore version 8.1 the setting is not in Sitecore.Analytics.config file.




Friday, 23 September 2016

Using the x-path builder in Sitecore 7.5 +

The Developer Tools link has disappeared from Sitecore 7.5. 

Here's how you get to the developer tools:

http://[Site Host Name]/sitecore/shell/default.aspx?xmlcontrol=IDE

Wednesday, 11 May 2016

ERROR Error in FileWatcher. Internal buffer overflow

On one installation of Sitecore 8.1 update 2 that I recently did, I noticed lots of errors in the logs like:

5404 15:52:21 ERROR Error in FileWatcher. Internal buffer overflow.
Exception: System.IO.InternalBufferOverflowException
Message: Too many changes at once in directory: D:\inetpub\...\Website\.

As explained here: http://mikael.com/2016/01/sitecore-file-watcher-internal-buffer-overflow-exception/ 

The resolution oddly enough is to move the license file to a subfolder of the data directory.

Email Experience Manager 3.2.1 Rev. 160127 Issue with Sample Package

I recently had to install the Email Experience Manager (ECM) for a client on Sitecore 8.1 update 2, and came across an issue when following the steps to smoke test the installation:

https://doc.sitecore.net/email_experience_manager/configuring_the_delivery_process/performance/testing_exm_performance_in_emulation_mode

The steps although not explicitly saying install the supplied Sample Newsletter package do refer to the same.  So I went ahead and installed the Email Experience Manager Sample Newsletter 3.2.1 rev 160127.zip that is supplied as part of this ECM package.  

N.B. The sample package like the main ECM package is part of a collection of 7 zip files contained in the zip file that you download from  (you'll need a Sitecore Login) the Downloads -> Email Experience Manager Link found on this page: https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_32/Email_Experience_Manager_32_Update1.aspx

When clicking on the Sample Newsletter item I got the following error:

Requested value 'Drafts' was not found. 

The error appears in a popover dialogue that it launched when the item is selected.

I used Resharper's dotPeek and was able to see what was going on:


The error I am seeing is happening in the MessageItemSource class where its calls MessageStateToString - it looks like the sample item is passing in a MessageType of Drafts - which doesn’t exist!

Simple answer is don't install the package until Sitecore fix this issue, but instead go ahead and create your own Sample Newsletter.
 

Tuesday, 10 May 2016

Sitecore WFFM Error on 8.1 update 2

On Sitecore 8.1 CD server after using the supplied SwitchMasterToWeb.config and having installed Web Forms For Marketers 8.1 rev 160304 - I get the following error when trying to access a form:

Unable to cast object of type 'System.String' to type 'Sitecore.Analytics.Reporting.ReportDataProvider'

The error occurs because Sitecore is trying to connect to the master Db and is getting a failure because it is not accessible. I suspect that SQL is returning a string error message instead of the expected object.

If you open up the SwitchMasterToWeb.config and comment out the following block it will resolve the issue:

<reporting>
  <dataprovider>
 <datasources>
   <add key="collection">
  <filtersfactory>
    <param desc="definitionDatabaseName" />web
  </filtersfactory>
   </add>
   <add key="reporting">
  <filtersfactory>
    <param desc="definitionDatabaseName" />web
  </filtersfactory>
   </add>
 </datasources>
  </dataprovider>
</reporting>