Drupal

Howto fix Drupal's update.php when $_REQUEST is denied by a paranoid sysadmin

I dont know how much people get to this problem, but one thing is sure: when you have a paranoid sysadmin, you might encounter some surprises with PHP and globals.

The annoying case is here when you restrict PHP to the maximum you can, you can't access to the $_REQUEST superglobal.

Drupal 5 modules release !

Crank yankers Yay

Working on a wide drupal site project, I had to make some custom modules, feeting to my needs. After some monthes, I finaly have stable releases for most of them, so I intend to release them to the community.

Here is a list of first set of modules:

  • formnode: this module allows site administrator to embed nodes into any form as markup text, setting weight of the node into the form. If form_store, form_collect and i18n modules are enabled, it uses those module to provide a really intuitive UI.

Migration d'un site SPIP vers Drupal 1/3


Update on February the 12th, 2010 : I'd advise to all people that stopped here googling the web about Spip to Drupal migration that they should consider looking at the concurrent spip2drupal Drupal project.

The last time I really did work on my own implementation was two years ago. I think you should not rely on my for this job.

Note for spip2drupal Drupal project developers : I can share what I did, and I think I did dawn robust code because I was working on a Spip site which live something like 5 or 6 Spip major upgrades, with a totally messed up database which means I had to handle *a lot* of edge cases.
I was originally using the Image Drupal project to handle Spip images, which is not anymore a recommended solution so my code is outdated; but it still remains a lot of work to handle different text encodings, database and encodings inconsistent states, and such things, so if you need help, ask me.



Méfiez vous surtout des URL absolues ! :) (bis, ter, et fini après)

Après avoir fait un patch très moche, m'être fait incendier par le mainteneur du module, j'ai décidé de réfléchir plus et d'introspecter plus loin pour voir d'où venait mes problèmes. Et j'ai trouvé, voici l'explication en couleurs !:

file_create_url() à tout cassé, parce que:

function file_create_url($path) {
// Strip file_directory_path from $path. We only include relative paths in urls.
if (strpos($path, file_directory_path() . '/') === 0) {
$path = trim(substr($path, strlen(file_directory_path())), '\\/');
}

Drupal et filtres: méfiez vous des caches (et surtout des URL absolues) !

Au cours de mes mésaventures avec Drupal, le module Image et les différents comportements des caches, j'ai fini par trouver la vraie cause de mes problèmes.

Pour récapituler mon précédent billet, mon problème était que certaines images affichées dans mes contenus Drupal avaient une URL en dur, ce qui provoquait des erreurs quand on changeait de site (donc de nom de domaine).

Pour comprendre le problème, il faut connaitre le contexte, j'ai donc:

* un serveur avec sa base de donnée, son apache, et son Drupal, sur un réseau interne non accessible depuis Internet

Drupal et filtres: méfiez vous des caches (et des images) !

Un bug étrange semble survenir lorsqu'on utilise le module Image de Drupal: lors de l'affichage de certaines images, le rendu calcule un chemin absolu (comprenant le nom de domaine).

Dans l'absolu, ce n'est pas un problème, sauf quand on transfert un site complet avec sa base de donnée sur un nouveau serveur, avec un nouveau nom de domaine.

Après 2 heures d'introspection du code du module img_assist, voici quelques notes intéressantes: