Applying a patch in Drupal core:

1. Download the patch,

2. apply: git apply -v [patch]

categorias:

I am using a solution of vbox (virtual box) and shared folders in our windows work environment (yes, unfortunatelly, but the IT team is in his right to decide which machines we have to use).

Everytime the vbox start, it mounts "automagically" one of the shared folders in the linux host (centos and archlinux, one day I will explain why). So then, apache has all what he needs in /var/www/html/ (simply mounted with "mount /var/www/html") (see automatically mount directories in vbox).

So far, everything was working fine... until I started to make small changes in small files. Absolutely surprising because when I deleted the complete code in the css or js file, for example, and I updated the browser, the screen appeared white, so everything seemed ok. But not at all, dealing with small changes, like adding a line in your css simply add no effect, the change is here, but seems that Apache or the browser didn't like it, simply it was being ignored.

After a while struggling about the browsers cache and even restarting the virtual box I finally decided to dig into Google.

I found the problem in the frankooh blog and it seems that it is a vbox problem, exactly a vboxsf problem with Apache.

The solution is simple, go to you apache configuration (in centos /etc/http/conf/httpd.conf) and uncomment the line:

EnableSendfile Off

After restarting Apache all the changes were sended to the browser without problems, even the small ones.

My name is Alejandro Moreno Lopez. I'm an spanish developer living in London, degree in Computer Science, who has specialized in PHP and Drupal development.

categorias:

Debugging cron issues and errors is one of the most tricky things in Drupal. If you are dealing with a big site, with people adding nodes, inserting content which you can't allways force to be commited in the right way, and things like that, it is not unusual to find a cron broken by some "misterious" node.

Well, it is quite easy to find this "misterious" offender, just logging the cron activity. How, very easy, with my new module "cron_killing_finder".

Just download it and follow the really simple instructions:

"Just activate it and go to /admin/reports/dblog. You'll find a "Node hook update_index: NID" string with the cron executions which tells you in last term which node is executed each time. If cron breaks, the last node reflected in the log will be the offender node, very simple :-)."

Hopefully it will be a new "complete" project, so you'll don't have to use git to download it.

categorias:

The error is quite enoying:

warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'GMT/0.0/no DST' instead

But it is quite simple to correct. It is not a drupal problem, but a linux/apache. Just go to your php.ini, for example /etc/php.ini in CentOS and add this line:

date.timezone = Europe/London

reboot apache and the problem will have dissapeared.

categorias:

Sometimes you need to upload files to, for example, validate an affiliate with whom you want to start to work.

The problem, is that these affiliate files need to be "clean", no template, no theme, just the code or validation string which they send.

The solution can be very complicated, like creating a new theme just for a group or a contect of pages... or as simple as creating a node with the string which we need and executing a php code with an exit command. Something like this:

valicationStringLikeUZasdBNf6asdfT2asdfafjpdadf===58QYg==

<?php

exit;

?>

so, when you open this node, you'll see a blank page like the one in the screenshot.

Well, i don't like to use php inside nodes, this practice must be avoided, but for this case, the code is enough simple and, the most important thing, it doesn't break the cron execution. So, everyone happy :-).