You can't turn back the clock. But you can wind it up again.

I started working on a new Umbraco package a while ago that begain its life as a Class Library. It had been a long day and some time into the project I decided I actually needed my project to be a Web Application Project but there was no obvious way to convert between the two. I suppose I could just create a fresh new project and move my existing files into it but that would be too easy. I opened the two project files in Notepad++ and after some trial and error discovered that if you copy the line below into your Class Library project file beneath the <ProjectGuid> node and save it then re-open your project in Visual Studio you will magically have a Web Application project that you can add your custom user controls etc to. [code language="xml"]{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}[/code]…

Read this post

Working on a project this morning and had some trouble finding a way to output the label for a checked radio button input control so thought I would share it in case it is of any use to someone else: [code language="javascript"]$('input[name=myRadioButtonListName]:checked + label').text()[/code] Always interested to hear of any alternative/improved methods of achieving the same goal?…

Read this post

Umbraco : No node exists with id '1040'

Posted in   Umbraco

When Umbraco 4 was first released I had issues with 2 of the upgrades from v3 in that the templates disappeared from the UI and clicking on any of the DocumentTypes resulted in an exception taking the form of "No node exists with id '1040'". Today I was working on the site again and it was bugging me so I checked the forums and found this post however it wasn't resolved as far as I could tell. I did a little digging around in the database and found some references in the cmsTemplate table to template master documents with the id 1040...bingo! I changed all references to a suitable master template that did exist and all of the above issues magically went away. I thought it was too much of a coincidence for the node id in the exception to be the same for others as it was…

Read this post

In a project I am currently working on there is a facility for Umbraco users to export Membership and Profile data. As part of the export the client also wanted to include the groups a member belongs to and here is how I achieved it, I hope it is of use to someone else. [code language="c#"]Member m = new Member(mid); // Loop through the member groups and add them to the field foreach (MemberGroup mg in m.Groups.Values) { //- Do your stuff in here, e.g. csv.Append(mg.Text); // Appends the Member group name }[/code]…

Read this post

A project I am currently working on needs the facility to export a couple of thousand users and user profiles and I was getting out of memory errors. A quick search helped me discover that rather than editing the php.ini to increase memory for all sites on the server I can do it on an individual site basis in the settings.php file for the site. If it doesn't already exist add the following line: [code language="php"]ini_set('memory_limit', '16M');[/code] ...to your sites/default/settings.php file and amend the value accordingly until you achieve the upper memory limit required. More information and alternative methods of achieving the same outcome can be found in the Increasing PHP memory limit document on the Drupal site.…

Read this post

Invalid object name 'umbracoUser'

Posted in   Umbraco

Yet another problem on an Umbraco v4.0 site I am working on currently. The site will be hosted on a VPS with Plesk as mentioned in an earlier post, I needed to restore a backup of the remote database locally but after restoring it my local development copy throws the exception "Invalid object name 'umbracoUser". After an hour or so of frustration and searching for a solution I realised that the table owner and schema belong to a user on the remote data source which didn't exist locally. <strong>The Solution:</strong> Run the following SQL statement and output to text and it will generate all of the ALTER statements need to change ownership of the object to DBO(Database Owner): [code language="sql"]SELECT 'ALTER SCHEMA dbo TRANSFER ' + s.Name + '.' + p.Name FROM sys.tables p INNER JOIN sys.Schemas s on p.schema_id = s.schema_id WHERE s.Name = 'EXISTING_OWNER_USERNAME'[/code]…

Read this post