drupal

Do we need git squash and thus forced pushes?

Weird unnatural bug

As a followup on A pinch of Symfony for D8MI? why do we need to squash?

After some more squash and push -f attempts regarding pull request for Symfony I get the hang of it.

But chx said in squash is bad as we loose history on the development process.

So how should we do this on d.o when git phase 3 lands? Those discussion seems to got to a halt.

Drupal 8 Modules Graph

Below a graph generated from the module list of a Drupal 8 development site.

fixing drupal info files on php 5.3

http://www.justsaypictures.com/images/189-800-600-cutest-kitten-in-the-world.jpg

Trying some Drupal 5 sites for upgrade script development on desktop PHP 5.3 I ran on *.info files causing annoyances.

Using ctools modal forms for node edit

For a drupal 6 site I needed a node edit overlay. This is what I did.

Define the urls ajax/node/%node/edit and nojs/node/%node/edit. The idea is to use path similar to the normal drupal paths just prepended with what ctools modal needs. It needs are minor in that the url path must contain a string nojs and in this case a class attribute ctools-use-modal.

<?php
function annotate_ym_menu() {
$items['nojs/node/%node/%'] = array(
'page callback' => 'annotate_ym_ajax_node',
'page arguments' => array(0, 2, 3),

Who is currently online

I want to run svn up on the site but I need to offline it first. So who is online?

SELECT name, mail, (unix_timestamp()-access)/3600 AS hours
  FROM users
  HAVING hours < 1
  ORDER BY access;

Or for short

drush sql-query "select name, mail, (unix_timestamp()-access)/3600 as hours from users having hours < 1 order by access;"

Updating drupal core

I never tried to do an core update on the command line. Today I tried it.

Get the latest drupal version

drush dl

Check your download

ls
drupal-6.x

Checkout svn drupal-6-core

svn --username=build2be chechout http(s)://my-svn/drupal-6-core/trunk/

Step into drupal version to update

cd trunk/www

Apply the patch

From _en_ into a translatable _en_

On a multi language site it is desirable to translate the drupal English into the customers Englich likings.

Steps taken

  1. Goto /admin/settings/language/add
    1. Add a custom languages with language prefix en, name en-ours, english English @ Our place and native English @ Our Place
    2. Make your new language the default.
    3. Disable drupal's en
    4. Change the name en-ours into en

Drupal site forensics

What tools do we have for a forensic research of a Drupal site. This question popped into my head after seeing a request on the consulting mailing list.

My naive approach is

wget -r -l 1 example.com

This way we get a one link level deep site of which we can grep the modules used on these pages. Then grep -r -h "modules" | sort -u gives a nice idea of the modules used.

But this beauty gives us the full file names.

grep -h -r -o "[[:alnum:]\/]*modules[[:alnum:]\.\/]*" * | sort -u | xargs -I {} echo {}

free form:

Subscribe to RSS - drupal