Menu access, a new pitfall when going back to Drupal 5
Submitted by Heine on Mon, 25/05/2009 - 11:56.
If you spend a lot of time exclusively in one Drupal version, you develop muscle memory for its API. This can be pretty dangerous as I caught myself writing the following menu item while backporting a Drupal 6 module.
Note the array('adminster foo') instead of user_access('administer foo'). As non-empty arrays evaluate to TRUE in non-strict comparisons this is equivalent to 'access' => TRUE, granting access to all users.
Because I do not believe in the "Found a bug? Blog about it!"-approach to bugfixing, I filed #472160, but still wanted to share.
Drupal 6: $base_path doesn't always point to the frontpage
Submitted by Heine on Sun, 17/05/2009 - 18:13.
Dear themers,
.... in page.tpl.php breaks Home functionality on many multilingual sites.
Consider a multilingual site with English (prefix 'en') as the default language and Dutch (prefix 'nl') as a second language. While browsing the site in Dutch (eg http://example.com/nl/node/5), the homelink created with $base_path leads to http://example.com/, which is the default English content. Quite an unpleasant surprise for your visitors.
The correct URL to the homepage is $front_page. As this variable holds a URL, you still need to convert it to HTML by calling check_url on it:
If you maintain a theme on Drupal.org that doesn't use $front_page, please consider this a bugreport. Thanks.
A new form element in Drupal core
Submitted by Heine on Wed, 28/01/2009 - 08:48.
With Commit #167487, a new form element has been added to Drupal core (7.x) to provide an alternative means of selecting items. Now, next to 'select' (combobox, list), checkboxes and radios, core carries the 'tableselect' element. This element allows developers to easily create tables with selectable rows. Ideal for those situations where you have to provide a lot of data on the items to the user.

The backstabbing March-Hare
Submitted by Heine on Thu, 22/01/2009 - 00:19.
If you use the CVSNT free/open source edition to commit to Drupal.org, drop to the command line and check your version with:
CVSNT version 2.5.04 or later inserts advertising in every commit message. Please, either buy a license for the CVSNT Suite, download an older version, or switch to another client.
Update: If you are a masochist and write your commit messages on the commandline, you may work around this issue with cvs -M "message" instead of cvs -m "message".
My apologies for Commit #160834 & Commit #165785.
Drupal HEAD and HTTP 500 errors on IIS 7
Submitted by Heine on Fri, 09/01/2009 - 11:41.
If you use PHP via FastCGI on IIS 7 and installing Drupal HEAD (7.x-dev) results in an HTTP 500 error, you may need to increase a number of timeout settings. The PHP.ini ones are fairly straightforward, but setting the activityTimeout for the FastCGI module is not intuitive.
Open a Command prompt with Administrative rights and enter:
The path to cgi should be replaced with the path of the PHP binary you registered with IIS. You must wrap the path in additional double quotes if it contains spaces. Example:
To get easier access to such settings, install the Administration Pack for IIS:
Drupal clean URLs on IIS 7
Submitted by Heine on Thu, 16/10/2008 - 08:57.
To get Clean URLs working on IIS 7, install the new URL rewriter module (x86, x64) and add the following to the system.webServer section of the sites' web.config:
<rules>
<rule name="Drupal clean URLs" enabled="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" negate="true" pattern="/favicon.ico$" />
</conditions>
<action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
You also need to install a hotfix to correct REQUEST_URI behaviour when using PHP via the FastCGI module. See KB954946 for more information. A symptom of this problem is when all form submissions get redirected to the frontpage of the site.