Saturday, 27 April 2013
Drupal code sprint
There is a 2 day code sprint at the TechHub Campus this weekend. I attended today and had a great time there.
First I went to the local open government sprint, no idea why. I managed to escape and ask some police officiers about the Drupal sprint. Obviously they had no idea about it. After a little search I managed to locate the room. We've got a nice breakfast and later pizza for survival purposes.
First I was struggling in finding a task to work on. Typically all the issues I've checked out was too busy or deadly. Then I joined to the Devel module table where Pedro Cambra, a co-maintainer of the module was kind to help us to pick up issues.
And miracle happened, the tickets I've got were doable. Some required testing, or just checking if the bug is still related. Some issue queue polishing and some real bug hunting. There was one interesting one. Devel's dpm() function didn't print anything on the display in certain conditions. I managed to reproduce it but it just made everything harder.
dpm() is just a decorator over drupal_set_message() - which uses the PHP Session in order to persist the message. You delete the message from the session only if you call drupal_get_message(). When you do a form submit it doesn't happen at the first request. I was checking the Session variable from the submit until the end of the PHP process - and surprisingly it was fine, it contained the message. However the very next request didn't. Like if something filters out the message tag when saving it into the session. I've never checked it in Drupal so open the terminal and looked for the sessions. I didn't find the one that Drupal was using - and then I realized it's stored in the database. And then I set some breakpoint there too - exception says we lost the database.
So what happened is that in MySQL we can define a maximum allowed packet size. In Drupal - especially with Devel + Krumo we have quite large messages - mine was 4.5 megabytes. I increased the my.cnf setting and voila - it worked. (link to the issue queue)