Top Banner
R.E.A.D How to select the right modules https://2015.midcamp.org/node/1106 Florida Drupal Camp 2015 #fldc15
97
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

R.E.A.DHow to select the right moduleshttps://2015.midcamp.org/node/1106

Florida Drupal Camp 2015#fldc15

Page 2: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Who You AreNew to Drupal.Want to improve habits.Session curious.

Page 3: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Your RoleA Drupal developer.A site architect.Functionality decision maker.

Page 4: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

What it is all AboutHow to quickly make smart, informed functionality decisions.

Page 5: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

What we will CoverSteps to decide between a contrib, patched or custom module.Real world examples of R.E.ADBasics of a patch & Basics of a custom module.

Page 6: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Michael MilesFrom: Boston, MA

Work:   @WeAreGenuine(.com)Genuine

Exp: Working with Drupal since 2008.Recently named an Acquia M.V.P

Twitter: @mikemiles86 Drupal.org: mikemiles86 All the Places: mikemiles86

Page 7: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

R.E.A.DResearch what exists.Evaluate the options.Analyze the gap.Determine amount of change.

Page 8: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Research What Exists

Page 9: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Isolate KeywordsRead documentation, specs, etc...Pay attention to unique nouns and verbs.Ask questions!

Page 10: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Perform Searches30k+ Modules available.Favorite search engine "Drupal [keyword]".Search on Drupal.org

Page 11: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Utilize the CommunityUse IRC: #drupal, #drupal­support.Use Stack Exchange:  .Social Networks: G+, Facebook, LinkedIn.Even reddit!  .

drupal.stackexchange.com

reddit.com/r/drupal

Page 12: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Isolate Keywords.Perform Searches.Utilize Community.

Page 13: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Evaluate the Options

Page 14: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Read the DescriptionWhat does the module do?What does the module not do?What does the module depend on?

Page 15: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Community AdoptionDownloads vs. Installs vs. Age.Activity of issue queue.Issues are good, not bad!

Page 16: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Maintainer ActivityParticipate in issue queue?Accepting of feedback?Regular commits and/or releases?

Page 17: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Read the description.Check community adoption.Check maintainer activity.

Page 18: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Analyze the Gap

Page 19: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Download and Test the ModuleGain a better understanding.Use a sandbox:  .What is offered out of the box?

simplytest.me

Page 20: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Discover Missing FunctionalityWhat does it not do?Missing 80%? Missing 20%?Bigger gap = Bigger effort.

Page 21: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Check for Community SolutionsLook at the issue queue.Search "Drupal [module] [functionality]".Ask questions!

Page 22: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Download and test the module.Discover missing functionality.Check for comunity solutions.

Page 23: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Determine Change

Page 24: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Review the Module CodeDoes it follow coding standards?Is it extendable?Can you figure out what does what?

Page 25: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Estimate EffortHow much code to rewrite?How much code to add?How much time is there?

Page 26: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Extend or AlterAdding functionality?Changing functionality?Changing the modules goal?

Page 27: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Review module code.Estimate effort.Extend or alter?

Page 28: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules
Page 29: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Examples

Page 30: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Scenario #1

Page 31: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

The RequirementsWHEN SAVING A FILE ENTITYAND IT IS A JPEG IMAGETHEN THE EXIF META DATA NEEDS TO BE CAPTUREDAND MAPPED TO CUSTOM FIELDSAND THESE MAPPINGS NEED TO BE EXPORTABLE USING FEATURES

Page 32: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Research What Exists

Page 33: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Isolate Keywords

WHEN SAVING A FILE ENTITYAND IT IS A JPEG IMAGETHEN THE EXIF META DATA NEEDS TO BE CAPTUREDAND MAPPED TO CUSTOM FIELDSAND THESE MAPPINGS NEED TO BE EXPORTABLE USING FEATURES

Page 34: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Perform SearchWe will focus on the keyword "Exif"

Page 35: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Search Google

Page 36: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Utilize the Community

Page 37: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Evaluate the OptionsExif custom seems like best fit.

Page 38: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Read the Module Description

Page 39: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Look at Community Adoption

Page 40: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Look at Maintainer Activity

Page 41: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Analyze the Gap

Page 42: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Download and Test the Module

Page 43: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Discover Missing Functionality

Page 44: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Check for Solutions

Page 45: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Determine Change

Page 46: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Review Code

Page 47: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Estimate EffortAdd Features integration.Alter primary key for mappings.Time is minimal.

Page 48: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Extend or AlterAdding features support.Not changing what module does.Extending.

Page 49: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Which Path to ChooseUse module as is.Patch module.Write own module.

Page 50: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Patch!Module meets 90% of needs.Small gap, small effort.Extends module.

Page 51: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules
Page 52: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

What is a Patch?.

A structured list of changes to files.Re­appliable to files.Focused on a single change.

drupal.org/patch

Page 53: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Creating a Patch

Page 54: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Clone and branch module git repo.

Page 55: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Make changes to code.

Page 56: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Test your changes.

Page 57: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Generate patch file.

Page 58: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

diff --git a/exif_custom.features.inc b/exif_custom.features.incnew file mode 100644index 0000000..243bbe2--- /dev/null+++ b/exif_custom.features.inc@@ -0,0 +1,158 @@+<?php+/**+ * @file+ * Features file for the exif_custom module.+ */++/**+ * Implements hook_features_api().+ */+function exif_custom_features_api() {+ return array(+ 'exif_custom' => array(+ 'name' => t('EXIF Custom mappings'),+ 'default_hook' => 'exif_custom_export_maps',+ 'feature_source' => TRUE,+ 'default_file' => FEATURES_DEFAULTS_INCLUDED,+ 'file' => drupal_get_path('module', 'exif_custom') . '/exif_custom.features.inc',+ ),+ );+}+...

Page 59: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Submitting a Patch

Page 60: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Create/comment on issue queue.

Page 61: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Attach your patch.Follow patch naming standards

[module]­[description]­[issue­number]­[comment­number].patch

Page 62: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Watch for feedback.

Page 63: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Wait for merge. (hopefully)

Page 64: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Giving back to thecommunity

Page 65: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Scenario #2

Page 66: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

The RequirementsWHEN SITE USES WORKBENCH TO MODERATE CONTENTTHEN CAN CREATE MULTIPLE TRANSITIONS BETWEEN STATESAND TRANSITIONS ARE EXPORTABLE USING FEATURES

WHEN EDITNG A CONTENT REVISIONTHEN CAN SCHEDULE A TRANSITIONAND CAN SELECT DATE FOR FIRST STATEAND CAN SELECT DATE FOR SECOND STATE

Page 67: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Research What Exists

Page 68: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Isolate Keywords

WHEN SITE USES WORKBENCH TO MODERATE CONTENTTHEN CAN CREATE MULTIPLE TRANSITIONS BETWEEN STATESAND TRANSITIONS ARE EXPORTABLE USING FEATURES

WHEN EDITNG A CONTENT REVISIONTHEN CAN SCHEDULE A TRANSITIONAND CAN SELECT DATE FOR FIRST STATEAND CAN SELECT DATE FOR SECOND STATE

Page 69: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Search for Existing ModulesWe will focus on the keywords "workbench schedule"

Page 70: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Search Drupal

Page 71: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Evaluate the OptionsLook at Scheduler Workbench Integration.

Page 72: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Read the Module Description

Page 73: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Look at Community Adoption

Page 74: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Look at Maintainer Activity

Page 75: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Analyze the Gap

Page 76: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Download and Test the Module

Page 77: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Discover Missing FunctionalityUnable to create different transitions per type.Unable to select per revision.No features support.

Page 78: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Determine Change

Page 79: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Review Code

Page 80: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Estimate EffortRefactor creating schedules & transitions.Decouple transitions from content types.Add Features integration.Will take time.

Page 81: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Extend or AlterChanging how transitions/schedules are created.Changing purpose of module.Altering.

Page 82: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Which path to choose?Use module as is.Patch module.Write own module.

Page 83: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Build a custom module!Too big/complicated to be a patch.Would alter module goals.No other module exists to support use cases.

Page 84: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules
Page 85: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Writing a Module.

Follow Drupal coding standards.Make use of hooks and APIs.Test your code!

drupal.org/developing/modules

Page 86: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Contributing a ModuleAsk yourself:

Could others use this?Seriously, is it abstracted enough?

Page 87: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Name module appropriately.Namespace based on dependencies.Be clear, not clever.Should indicate what module does.

Page 88: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules
Page 89: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Provide a detailed description.Explain what module does and does not do.Outline any dependencies.Help fellow R.E.A.D­ers.

Page 90: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules
Page 91: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Be a good maintainer.Bugs are badges not bruises.Participate in the issue queue.Update, release and improve.

Page 92: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules
Page 93: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Let's review

Page 94: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Remember to R.E.A.DResearch what exists.Evaluate the options.Analyze the gap.Determine amount of change.

Page 95: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Slides & Notesbit.ly/fldcREADbit.ly/fldcREADslidesbit.ly/drupalREAD

Page 96: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

Feedback@mikemiles86

#fldc15

Page 97: Flcamp2015 - R.E.A.D: Four steps for selecting the right modules

 #fldc15 R.E.A.D /  Michael Miles

Thank You!