GVS is now part of Acquia. Acquia logo

Files from my DrupalCon San Fransisco session on theme preprocess functions

Attached to this post at the bottom is an archive of the theme I was using including my theme files that I used today in my session on theme preprocess functions.

Don't forget to get the devel module in order to use the function dpm()

For those of you who witnessed the problems I was having today, the reason I couldn't get load the right data was because I was getting a MySQL error because I was trying to push too much information using dpm().

Warning: Got a packet bigger than 'max_allowed_packet' bytes query: ...

This is because I was pushing data into $messages with dpm() in mytheme_preprocess_page() on subsequent page requests, which means $vars['messages'] was recursing. Eventually, I exceeded the PHP memory limit and PHP would die in the theme layer which is output buffered so $_SESSION wasn't being refreshed. Anyway, live debugging at it's finest.

To avoid this problem yourself, make sure you aren't using dpm() in preprocess_page() on too many successive requests. Do it once, refresh twice, then comment it out next time.

If you attended the talk and didn't take the survey, please visit the survey page to do so.

Thanks!

AttachmentSize
mytheme.tar_.gz373.49 KB

GVS projects

CertifiedToRock.com was created to allow community members and employers to get a sense of someone's involvement with the Drupal project.

GVS is now part of Acquia.

Acquia logo

Contact Acquia if you are interested in a Drupal Support or help with any products GVS offered such as the Conference Organizing Distribution (COD).

We Wrote the Book On Drupal Security:

Cracking Drupal Book Cover