Blogs

The Web Mechanic Has Moved to Drupal 8!

Now that Drupal 8 has been released, webmechanic.org has moved to a Drupal 8 platform. Blog posts will not be migrated to the new site (since some involve custom modules that demonstrate issues specific to Drupal 7), but this Drupal 7 installation and all of its current blog posts will continue to be available at webmech.biz.

PHP Timeout on Windows/IIS

Have you ever run a PHP utility script on a Windows/IIS platform and had it unexpectedly timeout? Your IIS settings for script timeouts might be conflicting with your PHP settings.

Let's say your script is querying a remote, third-party web service for share data on 3000 articles on your site, and for whatever reason, the web service only allows you to query share data for one URL at a time. This could take a while. So on your Windows/IIS server, you set up a scheduled task to run at 1:00 am to retrieve all this data and put in your database for convenient access.

A State Machine With an Unknown Outcome

Recently, I was tasked with creating an event registration process for an existing Drupal site. This project would move the user through a number of possible paths to the final outcome of registering (or not registering), so building it as a finite state machine (using the state design pattern) seemed a good fit and would provide a flexible, easily modified, object-oriented structure for event registration.

Drupal tightens up node_load()

The other day we had an error on our Drupal 7 site where users would receive error messages whenever they tried to register for a conference. The site would register them, but the only thing the user would see is a JavaScript dialog box with an AJAX callback error message with some code in it; since the users didn't know that the site had registered them, they kept clicking the register button, getting registered multiple times. Not a desirable state of affairs.

Loading Form Definition Include Files in Drupal 7

Recently I had to include a form within an existing set of nodes (using hook_node_view), and this form had to make an AJAX callback. I put the form definition and Ajax callback function in a separate file for convenience.

From my_ajax_test.module:

Subscribe to RSS - blogs