• Save
Taking your module from Drupal 6 to Drupal 7
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Taking your module from Drupal 6 to Drupal 7

  • 4,361 views
Uploaded on

Learn how to take your module from D6 to D7 with this presentation from Senior Developer Tobby Hagler. This talk was given at CapitalCamp in Washington, DC.

Learn how to take your module from D6 to D7 with this presentation from Senior Developer Tobby Hagler. This talk was given at CapitalCamp in Washington, DC.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • I Got The Full File, I Just Wanna Share to You Guyszz.. It's Working You Can The Download The Full File + Instructions Here ://http://gg.gg/setupexe
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
4,361
On Slideshare
4,316
From Embeds
45
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
1
Likes
2

Embeds 45

http://localhost 45

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Taking Your Module from Drupal 6 to Drupal 7
    • Tobby Hagler, Phase2 Technology
  • 2. Overview
    • How does this affect your work as a developer
    • Biggest module changes from D6 to D7
    • Steps to upgrade
    • Potential Complications
  • 3. How this affects your work as a developer
    • State of documentation
    • Where did this hook go?
    • Not my module
  • 4. State of documentation
    • Converting 6.x modules to 7.x – drupal.org/update/modules/6/7
      • Converting 6.x modules to 7.x: Categorical – drupal.org/node/394070 (incomplete)
      • API Documentation – api.drupal.org
  • 5. Where did this hook or function go?
    • Some hooks have been broken out into more specific hooks with specific function parameters
    • Some have simply changed names to something more meaningful
  • 6. Not my module, and there's no 7.x version
    • Check for a 7.x branch in git
    • Module maintainers welcome patches – even 7.x upgrade patches
    • Check issue queues for 7x patches that may not have been committed yet
  • 7. Biggest module changes from D6 to D7
    • Module structure
    • Core hook changes
    • Contrib modules incorporated into Drupal Core
    • Field API
    • Custom database tables or entities ?
    • Database API
  • 8. Module structure changes
      • .info file specifies core = 7.x
      • .info files specify all loadable code files
      • .info files can set configurations
      • Dependencies is now an array and allows for versions ( dependencies[] = views (>3.0) )
  • 9. Hook Changes: hook_nodeapi has become many hooks
    • hook_nodeapi basically becomes hook_node_$op
    • hook_node_load( $nodes, $types )
    • hook_node_view( $node, $view_mode, $langcode )
    • hook_node_insert( $node )
    • 11 hooks in total
  • 10. Hook Changes: hook_user has also become many hooks
    • hook_user basically becomes hook_user_$op
    • hook_user_load( $users )
    • hook_user_view( $account, $view_mode, $langcode )
    • hook_user_update( &$edit, $account, $category )
    • 8 hooks in total
  • 11. Hook Changes: hook_block has also become many hooks
    • hook_block_info
    • hook_block_configure
    • hook_block_save
    • hook_block_view
  • 12. Hook Changes: Other important hooks have changed
    • hook_perm -> hook_permission, which also allows for more user-friendly output
    • hook_form_alter can be used for node forms now, cleaning up potentially nasty nodeapi hacks
  • 13. Hook Changes: Other important hooks have changed
    • hook_perm becomes hook_permission
    • return array ('some permission' =>
    • array (
    • 'title' => t ('Better Permission Title'),
    • 'description' => t ('Helpful, descriptive text.'),
    • ),
    • );
  • 14. Hook Changes: Other important hooks have changed
    • hook_form_alter can be used for node forms now, cleaning up potentially nasty nodeapi hacks.
  • 15. Incorporated into Drupal Core
    • CCK is now Field API
    • Tokens
    • Imagecache became Image Styles
  • 16. CCK is now Field API
    • Not just for nodes
    • Can be used on any object that is “fieldable” like users and comments
    • Many of the custom CCK hooks have been replaced
    • Must Read: Updating CCK Field Modules from D6 to D7 – http://drupal.org/node/728792
  • 17. Steps to upgrade
    • Set up an instance of Drupal 7
    • Run Coder Review first
    • Try Coder Upgrade module
    • Manual upgrade
    • Creating and providing patches
  • 18. Using Coder Review
    • Fresh install of Drupal 6.x
    • Enable Coder – drupal.org/project/coder
    • Make sure your module is installed (does not need to be enabled)
    • Select your module and review recommendations
  • 19. Coder Review recommendations
  • 20. Set up Coder Upgrade
    • Fresh install of Drupal 7.x
    • Enable Coder Upgrade, other dependencies – drupal.org /project/ coder
    • For PHP 5.2, uncheck ‘Use separate process’
    • Place a copy of the 6.x version of your module in files/coder_upgrade/old ( permissions! )
  • 21. Coder Upgrade caveats
    • Coder 7.x-1.0-beta6
    • Libraries 7.x-2.x-dev
    • Grammar Parser Library 7.x-1.x-dev
    • Grammar Parser 7.x-1.x-dev
    • Grammar Parser goes in sites/all/libraries , not sites/all/modules
  • 22. Run Coder Upgrade
  • 23. After Coder Upgrade
    • Install your upgraded module
    • Read through the code to reacquaint yourself
    • Run Coder Review, using the ‘Converting 6.x modules to 7.x’ option
    • Test, test, test
    • Submit patch to project’s issue queue?
  • 24. Run Coder Review
  • 25. Upgrade by hand?
    • Update hooks
    • Update queries
    • Update core=7.x and see what happens
  • 26. Potential Complications
    • Use of libraries included into the module
    • Non-standard behaviors such as connecting to other databases
    • Code is too custom to be upgraded
    • Dependencies on modules that are not 7.x or deprecated
  • 27. Questions?
  • 28. Contact
    • thagler@phase2technology 
    • @phase2tech
    • 703-548-6050
    • d.o: tobby
    • Slides: agileapproach.com