Slides and notes from: How custom is too custom?

Slides and notes from: How custom is too custom?

Hi all, I am attaching the slides to the talk I gave today about custom code.

Also, I mentioned "drush make" and promised to post some example code. The following is an example of a section from a drush make file showing the version and patches for a couple of media-related modules. This shows how the drush make file can be useful to "lock down" a particular version/patch combination:

projects[media][download][type] = git
projects[media][download][revision] = 89287f76df1ff24409b3ec474c59218929385733
projects[media][download][branch] = 7.x-2.x
projects[media][patch][] = https://www.drupal.org/files/issues/wysiwyg_alt_and_title-2416701-30.patch
projects[media][patch][] = https://www.drupal.org/files/issues/view_mode_classes-2422153-9.patch
projects[media][patch][] = https://www.drupal.org/files/issues/remove_references_to-2714581-2.patch
projects[media][patch][] = https://www.drupal.org/files/issues/cannot_put_link_on_an-2707107-4.patch
 
projects[media_ckeditor][download][type] = git
projects[media_ckeditor][download][revision] = 7409f2c0923f7bd81e91303a9d6032505d89d1cf
projects[media_ckeditor][download][branch] = 7.x-2.x
projects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/ckeditor_converting-2707177-2.patch
projects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/media-insert_widget-2451959-7.patch
projects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/add_entry_in_ckeditor_s-2711129-2.patch
projects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/the_toolbar_button_does-2710841-2.patch
projects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/2455557-4.patch
projects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/open_media_popup_on-2713757-2.patch
projects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/add_classes_to_the-2712923-5.patch
 
On the other hand, if you simply need to use a specific stable version of a module, the syntax is much simpler. For example:
 
projects[pathologic][version] = 2.12
projects[plupload][version] = 1.6
 
I highly recommend, whenever possible, maintaining your contrib code in this way. It does take some discipline, since "drush dl" is so quick and easy, but it pays off in the long run. Here is a blog post with details about this approach: https://www.phase2technology.com/blog/creating-maintainable-sites-with-d...
Feel free to send any questions my way!

 

Last modified: 
Wed, 05/04/2016 - 4:51pm