Once again my recent work has brought me back around to messing around with Globalisation issues again. This time it is with regards to writing a customer payment provider for UCommerce implementing the HSBC XML API. Certain fraud rules were being flagged on all transactions during testing due to an incorrect or missing country code, checking the documentation again it reads "The 3 digit ISO country code for the customer’s country", this is in fact not the alpha but numeric country representation as defined by ISO 3166 Country Codes. Unfortunately this cannot be obtained through the .Net Framework alone as I have done with similar issues previously so I needed to write an extension method as advised by Søren Spelling Lund in this forum post. In case this is of use to anyone else I am posting up my extension method as this will also have uses outside of…
When upgrading sites from an earlier version of Umbraco prior to v4.7.0 you may encounter the following exception when trying to create new media items:The create dialog for "Media" does not match…
My router recently died on me and so I had to revert to using a crappy little router supplied to me by Virgin Media my internet provider. I do a fair amount of integration work with the SagePay payment service provider and so I need to configure my router to forward ports to my local instance of IIS in order to accept callbacks from the service. I've never had a problem with this before except now with this router I was getting the router admin page even though it was configured not to allow administration from outside of the network, I tried using my DynDns hostname and eventually got it hitting my local instance of IIS but the page would just never complete loading and hang indefinitely. The solution it seems was actually quite straight forward and requires an entry in your host file which you can find in…
I never found a solution that I was happy with for adding unique id's to a page body tag that didn't feel like a hack. I often need to do it for very specific CSS targeting so I introduce to you my current solution using the new Razor syntax inside of a master template in Umbraco. [code language="csharp"]<umbraco:macro runat="server" language="razor"> <body id="@Model.Id"> </umbraco:macro>[/code] <strong> UPDATED</strong>: The example above has now been updated to simplify it and require just a single piece of code inside of the inline-macro "@Model.Id" to output the current page id. Essentially all this is doing is appending the current node id to a string (in my case just the letter 'p') and adding it to the id attribute of the html body tag. I tend to also need to take this one step further and include the id of a…
It is good practice to check that a plugin is loaded before trying to use it, thankfully this is very simple as plug-ins are basically namespaces inside of jQuey so you can do the following: [code language="javascript"]if($().pluginName) { // Add any plugin specific code here }[/code]…
I am proud to announce that I gained Level 2 <strong>Certified Umbraco Developer</strong> Status at the start of the month! After investing the last 4 years or so into developing solutions with the Umbraco Content Management System I was given the opportunity to take level 2 certification in London at the start of December. I decided that the time was right to now get certified in order to qualify the skills I have learnt throughout my journey and to hopefully attract more Umbraco related work my way. Umbraco has grown dramatically over the last few years both in terms of it's popularity but at the same time it has matured into a very user-friendly and flexible content management solution that is now being adopted by some very large companies including Microsoft who are now really getting behind Umbraco and even think highly enough of it to use it…
Following the recent series of posts on issues I have had migrating client sites from IIS6 to IIS7, one common problem I had was on sites that use the ELMAH exception handler. The full exception message is "Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. An attempt was made to load a program with an incorrect format. ". Another easy fix for this one but rather than it being a config issue relating to the IIS version I believe this is more related to the move from a 32-Bit server to a 64-Bit Windows Server. To correct the issue you need to modify the advanced settings for your app pool to "Enable 32-Bit Applications".…
Further to my earlier post I encountered another issue migrating sites for a client from IIS6 to IIS7. If your site uses any httpHandlers or httpModules you will need to perform these steps to migrate…
I am in the process of migrating a large number of sites from a Windows 2003 Server to a Windows 2008 R2 Server for a client. When testing the migrated sites I kept getting the all too familiar 'Object reference not set to an instance of an object' exceptions. As the site was in debug mode at this stage I got the full stack trace and was able to pinpoint the problem to the Page.User object being null. Strange as it was working fine on IIS6 so there must be something different in IIS7 that is causing the exception. After some research I discovered an easy fix to the problem which requires you to add an attribute to the modules node in the system.webServer configuration section of your web.config file as follows: [code language="xml"]<modules runAllManagedModulesForAllRequests="true">[/code] Magically the error disappears after adding this. See the 'Tip/Trick: Url Rewriting…
I currently maintain two windows based servers in the cloud with Elastic Hosts, one of my own and one for a client. On both I have scheduled tasks running and noticed that the time was slipping on the execution of these tasks over time. It became apparent that the server was unable to maintain the correct time and I was unable to figure out why so a quick email to the support team and the issue was solved within the hour! It appears that the issue is the emulation of the hardware clock by the virtualization system. On Linux and other Unix based operating systems, the convention is that the hardware clock is permanently set to UTC (i.e. GMT without DST), and the operating system adjusts this for display. On DOS and Windows, the convention is that the hardware clock stores local time, and that the operating system adjusts…