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] = gitprojects[media][download][revision] = 89287f76df1ff24409b3ec474c59218929385733projects[media][download][branch] = 7.x-2.xprojects[media][patch][] = https://www.drupal.org/files/issues/wysiwyg_alt_and_title-2416701-30.patchprojects[media][patch][] = https://www.drupal.org/files/issues/view_mode_classes-2422153-9.patchprojects[media][patch][] = https://www.drupal.org/files/issues/remove_references_to-2714581-2.patchprojects[media][patch][] = https://www.drupal.org/files/issues/cannot_put_link_on_an-2707107-4.patch projects[media_ckeditor][download][type] = gitprojects[media_ckeditor][download][revision] = 7409f2c0923f7bd81e91303a9d6032505d89d1cfprojects[media_ckeditor][download][branch] = 7.x-2.xprojects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/ckeditor_converting-2707177-2.patchprojects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/media-insert_widget-2451959-7.patchprojects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/add_entry_in_ckeditor_s-2711129-2.patchprojects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/the_toolbar_button_does-2710841-2.patchprojects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/2455557-4.patchprojects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/open_media_popup_on-2713757-2.patchprojects[media_ckeditor][patch][] = https://www.drupal.org/files/issues/add_classes_to_the-2712923-5.patchOn 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.12projects[plupload][version] = 1.6I 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
Submitted by bfanning on Wed, 05/04/2016 - 4:42pm.
- bfanning's blog
- Log in to post comments