Drupal 7 development: first impressions Dennis Povshedny, madcap.nl
Minor stuff Like different *.info files format (dependencies[])
API somewhere changed As well as for D5 to D6 migration Versions 4.6 hook_form(&$node, &$param) 4.7 hook_form(&$node) 5 hook_form(&$node, $form_values) 6 hook_form(&$node, $form_state) 7 hook_form($node, $form_state)
Registry introduced Two tables in DB to hold all registered functions kind of OOP based on procedural platform Rebuild registry regularly with clearing cache, like: - call drupal_flush_all_caches() - truncate all cache_* tables
DB is now object oriented, baby! No more good old db_query; Use PDO (PHP Data Objects) instead; Looks like a hell at a first sight
D6 way $entry = db_query('SELECT parent_nid FROM {ts_activity_hierarchy} WHERE ts_activity_hierarchy.nid = ' . $nid);
D7 way $query = db_select('ts_activity_hierarchy');   $query->addField('ts_activity_hierarchy',  'parent_nid' );   $query->condition('ts_activity_hierarchy.nid', $nid);   $result = $query->execute();   $entry = db_fetch_object($result);
Translate, please! $num_revoked = db_delete('ts_activity_users')   ->condition('activity_nid', $nid)   ->condition('uid', $userid, 'IN')   ->execute(); db_query('DELETE FROM {ts_activity_users} WHERE activity_nid=' . $nid . ' AND uid IN (' . implode(',', $userid) . ')');
DB: guard pattern {   $guard = db_transaction();   ... }
Beautiful doc for deal with DB hell http://drupal.kollm.org/doxygen/drupal-phpdoc/class_select_query.html
 
How stable is UNSTABLE? Now we use UNSTABLE 9 even node_ tables has changed recently Shall I start or wait?
Other good practices Write Doxygen - style comments; Enjoy pure PHP5 cause PHP4 is no longer supported – feel free to use 'clone', etc ...
Thank you! Questions and ideas – welcome! Drupal 7 – just try it! :)

D7dev

  • 1.
    Drupal 7 development:first impressions Dennis Povshedny, madcap.nl
  • 2.
    Minor stuff Likedifferent *.info files format (dependencies[])
  • 3.
    API somewhere changedAs well as for D5 to D6 migration Versions 4.6 hook_form(&$node, &$param) 4.7 hook_form(&$node) 5 hook_form(&$node, $form_values) 6 hook_form(&$node, $form_state) 7 hook_form($node, $form_state)
  • 4.
    Registry introduced Twotables in DB to hold all registered functions kind of OOP based on procedural platform Rebuild registry regularly with clearing cache, like: - call drupal_flush_all_caches() - truncate all cache_* tables
  • 5.
    DB is nowobject oriented, baby! No more good old db_query; Use PDO (PHP Data Objects) instead; Looks like a hell at a first sight
  • 6.
    D6 way $entry= db_query('SELECT parent_nid FROM {ts_activity_hierarchy} WHERE ts_activity_hierarchy.nid = ' . $nid);
  • 7.
    D7 way $query= db_select('ts_activity_hierarchy'); $query->addField('ts_activity_hierarchy', 'parent_nid' ); $query->condition('ts_activity_hierarchy.nid', $nid); $result = $query->execute(); $entry = db_fetch_object($result);
  • 8.
    Translate, please! $num_revoked= db_delete('ts_activity_users') ->condition('activity_nid', $nid) ->condition('uid', $userid, 'IN') ->execute(); db_query('DELETE FROM {ts_activity_users} WHERE activity_nid=' . $nid . ' AND uid IN (' . implode(',', $userid) . ')');
  • 9.
    DB: guard pattern{ $guard = db_transaction(); ... }
  • 10.
    Beautiful doc fordeal with DB hell http://drupal.kollm.org/doxygen/drupal-phpdoc/class_select_query.html
  • 11.
  • 12.
    How stable isUNSTABLE? Now we use UNSTABLE 9 even node_ tables has changed recently Shall I start or wait?
  • 13.
    Other good practicesWrite Doxygen - style comments; Enjoy pure PHP5 cause PHP4 is no longer supported – feel free to use 'clone', etc ...
  • 14.
    Thank you! Questionsand ideas – welcome! Drupal 7 – just try it! :)