How to debug Drupal or ... How I fell in love with the debug() function

Let's say you see recurring error messages in your db log file and you want to try and pinpoint the issue to be able to apply a fix.
So, how do you go about debugging your code?

Well, there are many different ways. You could go old-school and use




Or you could go a step further and use


to try and pinpoint the source of the error.

Weather API update ...

Ok, so most of you will now have heard that the much used and loved unofficial google weather api has closed for good. In my previous post I mentioned this and gave you a couple of alternatives to use instead.

Now here is a follow up ...

Fix validation 'Byte-Order Mark found in UTF-8 File' in drupal installations

So I stumbled across this issue the other day. I usually make sure I save all my files as Encoded as UTF-8 without BOM. But somehow, somewhere there may be a file that was saved incorrectly and thus it will give you a validation error on w3c.

Now, how do you go about finding which file is causing the error? Is it a theme file, or is it a custom module or is it a drupal file which you may have modified (I know, hacking drupal core is BAD!)

The solution is: run a shell script to find the file causing the issue.

Find the BOM files:

Creating a custom module that mimics the node full view

I've called this module 'stadtinfo_subpage'.

It creates a tab menu item, registers a path alias for it and lets you change the template to suit you ..

Subscribe to RSS - drupal