Prolific Notion is the trading name of Simon Dingley a freelance web developer in Plymouth,
Devon, UK. Prolfic Notion offers freelance web development
services from the design & build of websites & ecommerce solutions
through to the development of functional web based applications and content
management solutions.
Prolific Notion is able to offer a number of additional complimentary services through it's partners who specialise in Search Engine Optimisation(SEO), Advertising, Marketing, Direct Mail, E-Training, Market Research and Lead Generation.
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 for me so I looked for a pattern in where this reference existed and they all seemed to be templates for what I think was the original Creative Website Starter (CWS) package. Would be interested in comments from others that might be able to confirm this.
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.
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
}
For some time now I have been getting javascript errors on a customers SQL2000 server with Enterprise Manager and I had no idea why. (more…)
In an ongoing project I am working on I needed to adapt a custom user control that was being used as a DataType in Umbraco. I needed to locate the nearest node that had a specific property set and default the selected value of my control to the value of the property in the parent document.
Here is the final piece of code:
//- Get the current document as our starting point
Document currentDoc = new Document(Convert.ToInt32(Request.QueryString["id"]));
//- Climb the tree looking for a parent node with the property set
while (currentDoc.getProperty("myProperty") == null)
{
currentDoc = new Document(currentDoc.Parent.Id);
}
//- Set the value in the list if it exists
if (this.myDropDownList.Items.FindByValue(currentDoc.getProperty("myProperty").Value.ToString()) != null)
{
this.myDropDownList.Items.FindByValue(currentDoc.getProperty("myProperty").Value.ToString()).Selected = true;
this.myDropDownList.Enabled = false; //-Disable the control so the branch can't be changed
}
Thanks again to Tim Geyssens for the tip that led me to my final solution.
Drupal logo
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:
ini_set('memory_limit', '16M');
…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.
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.
The Solution:
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):
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'
What you should find is that you are presented with a list of alter statements similar to those below which if you execute will change owner of all tables owned by the owner you specified in the first step and assign ownership to DBO:
ALTER SCHEMA dbo TRANSFER oldowner.cmsContent ALTER SCHEMA dbo TRANSFER oldowner.cmsContentType ALTER SCHEMA dbo TRANSFER oldowner.cmsContentTypeAllowedContentType ALTER SCHEMA dbo TRANSFER oldowner.cmsContentVersion ALTER SCHEMA dbo TRANSFER oldowner.cmsContentXml ALTER SCHEMA dbo TRANSFER oldowner.cmsDataType ALTER SCHEMA dbo TRANSFER oldowner.cmsDataTypePreValues ALTER SCHEMA dbo TRANSFER oldowner.cmsDictionary ALTER SCHEMA dbo TRANSFER oldowner.cmsDocument ALTER SCHEMA dbo TRANSFER oldowner.cmsDocumentType ALTER SCHEMA dbo TRANSFER oldowner.cmsLanguageText ALTER SCHEMA dbo TRANSFER oldowner.cmsMacro ALTER SCHEMA dbo TRANSFER oldowner.cmsMacroProperty ALTER SCHEMA dbo TRANSFER oldowner.cmsMacroPropertyType ALTER SCHEMA dbo TRANSFER oldowner.cmsMember ALTER SCHEMA dbo TRANSFER oldowner.cmsMember2MemberGroup ALTER SCHEMA dbo TRANSFER oldowner.cmsMemberType ALTER SCHEMA dbo TRANSFER oldowner.cmsPropertyData ALTER SCHEMA dbo TRANSFER oldowner.cmsPropertyType ALTER SCHEMA dbo TRANSFER oldowner.cmsStylesheet ALTER SCHEMA dbo TRANSFER oldowner.cmsStylesheetProperty ALTER SCHEMA dbo TRANSFER oldowner.cmsTab ALTER SCHEMA dbo TRANSFER oldowner.cmsTagRelationship ALTER SCHEMA dbo TRANSFER oldowner.cmsTags ALTER SCHEMA dbo TRANSFER oldowner.cmsTemplate ALTER SCHEMA dbo TRANSFER oldowner.umbracoApp ALTER SCHEMA dbo TRANSFER oldowner.umbracoAppTree ALTER SCHEMA dbo TRANSFER oldowner.umbracoDomains ALTER SCHEMA dbo TRANSFER oldowner.umbracoLanguage ALTER SCHEMA dbo TRANSFER oldowner.umbracoLog ALTER SCHEMA dbo TRANSFER oldowner.umbracoNode ALTER SCHEMA dbo TRANSFER oldowner.umbracoRelation ALTER SCHEMA dbo TRANSFER oldowner.umbracoRelationType ALTER SCHEMA dbo TRANSFER oldowner.umbracoStatEntry ALTER SCHEMA dbo TRANSFER oldowner.umbracoStatSession ALTER SCHEMA dbo TRANSFER oldowner.umbracoStylesheet ALTER SCHEMA dbo TRANSFER oldowner.umbracoStylesheetProperty ALTER SCHEMA dbo TRANSFER oldowner.umbracoUser ALTER SCHEMA dbo TRANSFER oldowner.umbracoUser2app ALTER SCHEMA dbo TRANSFER oldowner.umbracoUser2NodeNotify ALTER SCHEMA dbo TRANSFER oldowner.umbracoUser2NodePermission ALTER SCHEMA dbo TRANSFER oldowner.umbracoUser2userGroup ALTER SCHEMA dbo TRANSFER oldowner.umbracoUserGroup ALTER SCHEMA dbo TRANSFER oldowner.umbracoUserLogins ALTER SCHEMA dbo TRANSFER oldowner.umbracoUserType ALTER SCHEMA dbo TRANSFER oldowner.cmsContentTypes ALTER SCHEMA dbo TRANSFER oldowner.umbracoContent ALTER SCHEMA dbo TRANSFER oldowner.umbracoContentAll
After executing the above everything started working again as expected.
Thanks to a blog post by Steve Schofield that led me to the solution.
A project I am working on currently is hosted on a VPS with a Plesk control panel. When attempting to upgrade from RC3 to the final release the process kept getting stuck on the database check stage as it was trying to write to the web.config but it appears it needs to write a temporary file to the root of the hosting environment. At this point an exception was being thrown because within a Plesk hosted environment you can’t set write permissions on the root only on files and folders within it.
The following post led me to a solution that gets you past the step in the upgrade process that requires you to manually update the web.config, no hardship but just a bit of a PITA and will hopefully be addressed in future upgrades.
I recently upgraded TwitterBerry to v0.8 on my Blackberry Pearl and it stopped working, every time I tried to connect I got a ‘Network Request Failed’ error. My friend Google wasn’t much help so I emailed support at Orangatame Software which yielded no result and zero response which I thought was pretty lame since I did get an auto-response back from them stating “Thank you for submitting your question to us online. Case #00001998: “Network Request Failed” has been created and a Orangatame Customer Advocate will get back to you shortly.”
Anyhow, this morning I was messing with the settings and managed to get it working by configuring it to use a connection mode of BIBS whatever that is, so I am now able to start tweeting again from my phone!
For some reason or another I ended up with a corrupt default.aspx.designer.cs file in a recent web project, a quick check with my best friend(Google) and the solution it seemed couldn’t be easier. Delete the .designer file and right click the .aspx file and select “Convert to Web Application”…were you expecting more? Sorry, that’s all there is to it!
This is more of a note for myself but it’s handy little snippet for future reference to change the owner of objects in a MS SQL Server database. This is particularly handy when objects have been created by web applications and not set the object owner to dbo.
To view th source code for the stored procedure (more…)