Christopher Shennan’s Blog

A day in the life of…

Over the last few weeks I have been working on my first wordpress plugin and I am quickly getting to grips with how it all pieces together but I ran into a problem with a rather basic piece of functionality that pretty much rendered the plugin useless until I figured out the issue.

The section I was working on was a form submission (within the wordpress administation) which saved the form values into the database and then redirected the user upon success to another page (using wp_redirect) but this resulted in a blank content pane.

This seems very strange to me as it showed some of the page contents i.e. the header and left navigation but the content pane was completely blank.
continue reading…

Bookmark and Share

I just wanted to wish everyone a Happy New Year and all the best for 2010.  I hope that it proves to be a productive and successful year for you all.

I hope to get myself more motivated in 2010 and make 2010 a good year and work for me.  In this aim I hope to post a good few new blog entries on here over the next year and I’ve got a few in the pipeline already including a wordpress plugin I’m developing and moving Manage My Alerts over to Symfony 1.3/1.4 and I hope the entries I post are of use to you.

Once again I would like to wish you a Happy New Year and all the best for 2010.

References

Manage My Alerts – An online reminder service

Bookmark and Share

This Christmas was the quietest Christmas I have had in years in terms of the obligatory “if you have got the time” IT jobs as I only had 1 request for fixing a computer this year (instead of the 4 computers and a DVD player I had a few years back… all requested within 2 hours of arriving home).

Luckily this one turned out to be relatively simple and only took 5 minutes to fix although when I first heard about it I thought it was going to take a few hours. My aunt and uncle reported a problem with logging into their laptop (running Windows Vista Home Premium) on my uncle’s profile where it would give an error message “The User Profile Service failed the logon”, after which it would simply return them to the profile selection screen.
continue reading…

Bookmark and Share

Over the weekend I launched our newest site, The Weekly Whinge, which was set up as a place for me to vent my frustration and generally just rant and complain about life. As it has only just been launched my whinge list is relatively small so far but I’m finding ideas all over the place, on the way to work, out doing the Christmas shopping (it is probably best that I do not start on that one or I will never end), even with just updating this blog so I am sure there will be many more additions to The Weekly Whinge before long.
continue reading…

Bookmark and Share

A few months ago I posted an article taking about how to get the raw SQL from a Doctrine Query Object but with the release of Symfony 1.3 and Symfony 1.4 it would appear that the code no longer works.  As a result I’ve updated the code to work with Symfony 1.2 – 1.4 and you can find the updated source below:-
continue reading…

Bookmark and Share

csNews Pro

No comments

It’s taken me a while but I’ve finally managed to create the “My Projects” section started although in all likelyhood I’ll not have much time to devote to my projects.

I’ve started off by resurrection an old project that I worked on while I was self employed as Design2Host Ltd.  csNews Pro (formerly V-Desk Newsletter System Pro) has had a few cosmetic details changed (changed the name, removed the licence key limitions) but it’s exactly the same project and it is compatible with the paid version that was original available so you can easily convert from the previous paid version across to the free version when any updates become available.

Feel free to download and play with csNews Pro and feel free to give my any feedback on it.

Bookmark and Share

I am often importing data into a symfony project from an existing site or a CSV file and re-writing this data into the fixtures.yml is usually too complicated or time consuming so I end up writing bespoke import actions.

While I am writing these actions I often find that I have to delete the contents of the MySQL tables as you can never write the routine complete and accurate in one go so as you build it up in smaller steps you find that you have to get rid of the previously old data.

This presented me with 2 problems:-

  • Using DELETE FROM [TABLENAME] does not reset the auto-incrementing fields so if you have anything that is based on the id during the rest of the import then you’re going to have issues.
  • There is a lot of clicking in phpMyAdmin to empty the tables, especially if you forget about the foreign key relationships.

continue reading…

Bookmark and Share

Another day… another magento problem!

I was asked to look into a problem with an automated stock level update script not updating the stock levels.  This update script was using the Magento API and on the face of things everything looked ok as the script ran without any errors, the product prices got updated but the stock levels never changed.

After a bit of investigating I found the problem was caused by an incorrect usage of the Magento API and the original update statement was similar to:-

$proxy->call($sessionId, 'product.update',
	array('PRD0001', 
		array(
			'price'=>12.50, 
			'qty'=>12, 
			'is_in_stock'=>1, 
			'discontinued'=>0
		)
	)
);

However, the update of the is_in_stock and qty fields is not done against the product (via product.update) but against the product inventory (via product_stock.update) so this code had to be updated to the following:-
continue reading…

Bookmark and Share

Back in February 2009 I treated myself to a Resident Evil XBOX 360 Elite from Game and in all honesty I haven’t really played it much. It’s only been on maybe 10 days since I’ve bought it but I’ve got a bit more time of my hands these days so I’m starting to play it more and I’ve noticed that is sounds like a hoover when you’re playing a game.

I’m usually playing my XBOX at night and I have to keep the TV volume down so the audio is instantly drowned out by the noise of the XBOX and I would actually go as far as saying that my hoover is quieter than the XBOX (that may be a slight exaggeration but not by much!) so there isn’t that much that I would consider “Elite” about this XBOX.

continue reading…

Bookmark and Share

This has been updated to work with Symfony 1.3/1.4 – Please go to the updated article: Raw SQL from Doctrine Query Object – Revised

As my use of Symfony is increasing I find myself frustrated that there doesn’t appear to be an easy way to get the raw SQL from a doctrine query object so I can simply output it and paste it into phpMyAdmin to debug problems with the SQL. I may be wrong about this but as yet I have not found a built in function to perform this operation.

Sure I am able to output the query with the “?” indicating where the necessary values are to go and I can also easily output the array of query parameters so I can substitute these manually but this takes time and it would be much much simpler and quicker to just output the whole query with the substitution already done so it’s a simply copy and paste of the raw SQL from the doctrine query object straight into phpMyAdmin.

I have wrote a quick function to do this and I had meant to post this for a while but I just have not had the chance to get round to it until now.
continue reading…

Bookmark and Share