How to R.E.A.D Steps for selecting the correct module.
#PatchOrCustom, #justREAD
Slide 2
Who You Are. •
Site Builder •
•
Developer
!
•
•
Decision Maker
New to Drupal Want to re-enforce habits
Slide 3
What’s it all about.
How to quickly make smart, informed decisions.
Slide 4
What we’ll cover. •
Steps to decide between a contrib, patched or custom module.
•
Basics of patching.
•
Basics of writing a module.
Slide 5
Michael Miles •
Associate Director of PHP @ Genuine Interactive.
•
Drank the Drupal Kool-aid in 2008. (it’s grape flavored) !
•
Twitter: @mikemiles86
•
D.o: mikemiles86
@WeAreGenuine
Slide 6
A lover of memes.
Slide 7
How to R.E.A.D! (yay acronyms!) !
Slide 8
R.E.A.D •
Research what exists.
•
Evaluate the options.
•
Analyze the gap.
•
Determine amount of change. #justREAD
Slide 9
Research what exists.
Slide 10
Research what exists.
•
Isolate keywords about functionality.
•
Search for existing modules.
•
Use the community.
Slide 11
Slide 12
Evaluate the options.
Slide 13
Evaluate the options.
•
Read the module description.
•
Look at community adoption.
•
Look at maintainer activity.
Slide 14
Slide 15
Analyze the gap.
Slide 16
Analyze the gap.
•
Download and test the module.
•
Discover missing functionality.
•
Check issue queue for solutions.
Slide 17
Patch not found.
Slide 18
Determine amount of change.
Slide 19
Determine amount of change.
•
Review the module code.
•
Estimate how much has to be changed.
•
Do changes extend or alter module?
Slide 20
Let’s review.
Like developers…
Slide 21
…Flow Chart FTW! Use community solutions.
YES
Research.! Find modules?
YES
Evaluate.! find best fit?
NO
YES
Analyze.! is there a gap?
YES
NO
NO
Community solutions exist?
NO
Use existing module. Build a custom module. YES
Determine.! big change?
NO
Patch.
Slide 22
…Flow Chart FTW! Use community solutions.
YES
Research.! Find modules?
YES
Evaluate.! find best fit?
NO
YES
Analyze.! is there a gap?
YES
NO
NO
Community solutions exist?
NO
Use existing module. Build a custom module. YES
Determine.! big change?
NO
Patch.
Slide 23
Examples.
Slide 24
Scenario #1.
Slide 25
The Requirements. WHEN SAVING A FILE AND IT IS A JPEG IMAGE THEN THE EXIF META DATA NEEDS TO BE CAPTURED AND MAPPED TO CUSTOM FIELDS AND THESE MAPPINGS NEED TO BE EXPORTABLE USING FEATURES !
Slide 26
Step 1
Research what exists.
Slide 27
Research what exists.
Isolate keywords about functionality. WHEN SAVING A FILE AND IT IS A JPEG IMAGE THEN THE EXIF META DATA NEEDS TO BE CAPTURED AND MAPPED TO CUSTOM FIELDS AND THESE MAPPINGS NEED TO BE EXPORTABLE USING FEATURES. !
Slide 28
Research what exists.
Search for existing modules.
Slide 29
Research what exists.
Talk to the community.
IRC: #drupal, #drupal-support
Slide 30
Research what exists.
Find possible existing solutions
•
The Exif module
•
The Exif custom module
Slide 31
Step 2
Evaluate the options.
Slide 32
Evaluate the options
Read the module description.
Slide 33
Evaluate the options
Look at community adoption. Exif
Exif Custom
Slide 34
Evaluate the options
Look at maintainer activity.
Slide 35
Evaluate the options
Determine best fit.
Slide 36
Step 3
Analyze the gap.
Slide 37
Analyze the gap.
Download and test the module.
Slide 38
Analyze the gap.
Discover missing functionality.
Slide 39
Analyze the gap.
Check issue queue for solutions.
Slide 40
Step 4
Determine amount of change.
Slide 41
Determine amount of change.
Review the module code.
Slide 42
Determine amount of change.
Estimate how much has to be changed.
•
Requires little rewriting of code base.
•
Need to add new hooks and one new file.
Slide 43
Determine amount of change.
Will changes extend or alter the module?
Slide 44
Which path to choose?
•
Patch Exif Custom module !
•
Write own Exif module
Slide 45
PATCH!
Slide 46
What is a Patch? •
drupal.org/patch
•
A structured list of changes to a file.
•
Used to re-create changes to a files.
•
Focus on a single change.
Slide 47
How to create a Patch. •
Clone module repository.
•
Create a new branch.
•
Make changes to code.
•
Test changes.
•
Generate the patch.
Create a branch.
mm:exif_custom$ git checkout -b patch/features_integration
Slide 50
Make changes.
Slide 51
Test changes.
Slide 52
Create the patch file.
mm:exif_custom$ git diff 7.x-1.x > exif_custom-features_integration.patch
Slide 53
How to submit a Patch. •
Create/Comment on an issue.
•
Attach the patch. •
•
[description]-[issue-number]-[comment-number].patch
Revise based on testing/reviews.
Slide 54
Create an issue.
Slide 55
Attach the patch.
[description]-[issue-number]-[comment-number].patch
Slide 56
Slide 57
Contributing back to the community.
Slide 58
Scenario #2.
Slide 59
The Requirements. WHEN SITE USES WORKBENCH TO MODERATE CONTENT THEN CAN CREATE MULTIPLE TRANSITIONS BETWEEN STATES AND TRANSITIONS ARE EXPORTABLE USING FEATURES !
WHEN EDITNG A CONTENT REVISION THEN CAN SCHEDULE A TRANSITION AND CAN SELECT DATE FOR FIRST STATE AND CAN SELECT DATE FOR SECOND STATE
Slide 60
Step 1
Research what exists.
Slide 61
Research what exists.
Isolate keywords about functionality. WHEN SITE USES WORKBENCH TO MODERATE CONTENT THEN CAN CREATE MULTIPLE TRANSITIONS BETWEEN STATES AND TRANSITIONS ARE EXPORTABLE USING FEATURES !
WHEN EDITNG A CONTENT REVISION THEN CAN SCHEDULE A TRANSITION AND CAN SELECT DATE FOR FIRST STATE AND CAN SELECT DATE FOR SECOND STATE
Slide 62
Research what exists.
Search for existing modules.
Slide 63
Step 2
Evaluate the options.
Slide 64
Evaluate the options
Read the module description.
Slide 65
Evaluate the options
Look at community adoption.
Slide 66
Evaluate the options
Look at maintainer activity.
Slide 67
Step 3
Analyze the gap.
Slide 68
Analyze the gap.
Download and test the module.
Slide 69
Analyze the gap.
Discover missing functionality.
•
Unable to create different transitions per type
•
Unable to select different transitions for revisions
•
No features integration.
Slide 70
Step 4
Determine amount of change.
Slide 71
Determine amount of change.
Review the module code.
Slide 72
Determine amount of change.
Estimate how much has to be changed.
•
Will need to change how transitions are created.
•
Will need to change how schedules are stored.
•
Will need to add features integration.
Slide 73
Determine amount of change.
Will changes extend or alter the module?
Slide 74
Which path to choose?
•
Patch Scheduler workbench module !
•
Write own scheduler module
Slide 75
CUSTOM MODULE!
Slide 76
Module Writing Guidelines. •
drupal.org/developing/modules
•
Follow Drupal coding standards.
•
Make use of hooks and APIs.
•
Test your code.
Slide 77
Contributing a module. •
Is it functionality other could use?
•
Name appropriately.
•
Provide accurate description.
•
Be an active maintainer.
Slide 78
Name appropriately.
Slide 79
Provide detailed description.
Slide 80
Be an active maintainer.
Slide 81
Free QA and improvements from community.
Slide 82
Slide 83
How to R.E.A.D. •
Research what exists.
•
Evaluate the options.
•
Analyze the gap.
•
Determine amount of change. #justREAD