A Bash function to check Drupal database sizes

At times I'd like to check the size of databases used by Drupal.

But I don't like to launch apps like phpMyAdmin and Sequel Pro only for that. So I wrote a tiny Bash function to check Drupal database sizes.

Drupal 7 number quizzes

Here are quizzes on magical numbers related with Drupal 7.

How many numbers do you know of them? If you already know all of them, you're an awesome Drupal master certified by hgoto (me)! (But there's no certificate :) )

21 (days)

The default session expiration time. After 21 days (actually 2,000,000 seconds) since the session was created, user sessions expire.

Drupal 7: How to disable a content type

While developing a site with Drupal, at times I'd like to disable a content type without removing it. I just want to disable one.

The database table where content types are stored is node_type. And there's a column disabled in it. We can disabled a content type by changing the column value to 1.

There are APIs for that. We can use node_type_load() and node_type_save() to do it.

Drupal 7 で theme.inc で発生する Fatal error の対処方法

Drupal 7 で次のようなエラーに遭遇することがあります。

Fatal error: Unsupported operand types in /PATH/TO/DRUPAL_ROOT/includes/theme.inc on line 637


問題の原因は関数 _theme_process_registry() の中で連想配列とその他の何か(たいてい NULL )の加算が行なわれていることです。 そしてそれが起こるのは hook_theme() の戻り値が正しく指定されていないことが原因です。

次のような hook_theme() を書いていると発生します。