Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home1/tylerfra/public_html/includes/common.inc).

Apply a Patch to a Drupal Module

Category: 

So after rolling out a bunch of new changes to a website, which involved an update to the Date module, a bug was introduced that was not detected during testing.

After some research, the bug was well known in the Drupal community (http://drupal.org/node/523218). The bug happens with a CCK Date Field w/ both 'From date' and 'To date' options. When the 'Default value' is set to 'Now' and the 'Default value for To Date' is set to 'blank', the 'To date' is getting set to the same value as the 'From date'... which of course is not the desired behavior. After reading through the whole issue, it looked like the patch provided in comment #39 was the best.

In the example below I needed to apply the .patch file date_523218.patch to the file date_elements.inc

So to apply the patch:


  1. Download the .patch file
  2. Place the .patch file in the module's directory (e.g. sites/all/modules/date)
  3. Navigate to the same directory as the .patch file in a terminal window
  4. Execute this terminal command: patch --dry-run date_elements.inc date_523218.patch

You should see some output explaining the results of the 'dry run' if all looks well, remove the '--dry-run' option and then run this command: 

patch date_elements.inc date_523218.patch

You can always type 'man patch' into a terminal to learn more about the patch command. Be careful not to type 'man patch' into Google, or you may get some unwanted results.