Drupal: Add body classes based on user permissions

This one is a little bit more esoteric. I found the need change the page style (via CSS) based on whether the current user had permission to update the current node. Drupal preprocess_page to the rescue!

Just add this snippet to the yourTheme_preprocess_page function in your template.php file. It will add body classes (e.g., user-node-update, user-node-delete) to your page depending on the current user's permission to access the node being viewed.

Escape Views' replacement patterns

Views replacement patterns are great, but they take up valuable variable real-estate. If you need to literally output "[nid]" rather than the value of its corresponding replacement pattern, you might start hitting your head against the wall.

I found this issue to be particularly annoying when using the Prepopulate module, which required CCK field names (with bracketed arrays) to a URL.

Add a Drupal template suggestion for Panels: page-panel.tpl.php

Drupal has a standard array of template suggestions that let you specify which TPL file should be used according to node type, node id, etc. However, there is no default template suggestion for pages generated by Panels.

You can easily fix that by adding a little snippet to your template.php files' preprocess_page() function.

Downgrading from Views 6.x-3.x-dev to 6.x-2.x

You may notice that after downgrading, you receive and error like:

Unknown column 'view_php' in 'field list' query:..sites/all/modules/views/includes/view.inc on line 1722.

If so, backup your database and then run this mySQL query: ALTER TABLE views_view ADD is_cacheable tinyint; ALTER TABLE views_view ADD view_php blob;

Worked for me!

Apart from that, be sure that you've clear all of the Header, Footer, and Empty Text fields from all of your views.