Submitted by mindpiss on Fri, 25/01/2013 - 10:25
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
var_dump();
or
print_r();
.
Or you could go a step further and use
debug_backtrace();
to try and pinpoint the source of the error.
Submitted by mindpiss on Thu, 13/12/2012 - 17:19
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 ...
Submitted by mindpiss on Thu, 13/12/2012 - 16:43
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:
Submitted by mindpiss on Fri, 10/02/2012 - 13:57
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 ..