How to upgrade to Drupal 4.7.0 beta 3 gracefully
Yesterday, Drupal 4.7.0 beta 3 officially released. The upgrade procedure is quite simple 6 steps.
- Backup everything
- Log on as the first user with ID 1 aka admin
- Remove all the old Drupal files
- Extract new Drupal files into the place
- Modify configuration and copy add-on modules
- Run update.php
Anyway, there are a few bugs that I immediately found. These bugs has been patched in beta 2 so it is so easy to do now.
diff -ru drupal-4.7.0-beta3/modules/blogapi.module howforge4703/modules/blogapi.module --- drupal-4.7.0-beta3/modules/blogapi.module 2006-01-10 02:22:04.000000000 +0700 +++ howforge4703/modules/blogapi.module 2006-01-12 13:24:05.000000000 +0700 @@ -219,6 +219,9 @@ return blogapi_error(implode("\n", $errors)); } + if (user_access(’administer nodes’) && !isset($edit[’date’])) { + $edit[’date’] = format_date(time(), ’custom’, ’Y-m-d H:i:s O’); + } if (!node_access(’create’, $node)) { return blogapi_error(t(’You do not have permission to create the type of post you wanted to create.’)); } @@ -274,6 +277,9 @@ return blogapi_error(implode("\n", $errors)); } + if (user_access(’administer nodes’) && !isset($edit[’date’])) { + $node->date = format_date($node->created, ’custom’, ’Y-m-d H:i:s O’); + } $terms = module_invoke(’taxonomy’, ’node_get_terms’, $node->nid, ’tid’); foreach ($terms as $term) { $node->taxonomy[] = $term->tid; @@ -709,6 +715,17 @@ $xmlrpcval[’mt_convert_breaks’] = $node->format; } + $terms = module_invoke(’taxonomy’, ’node_get_terms’, $node->nid, ’tid’); + $categories = array(); + foreach ($terms as $term) { + $term_name = $term->name; + foreach (module_invoke(’taxonomy’, ’get_parents’, $term->tid, ’tid’) as $parent) { + $term_name = $parent->name . ’/’ . $term_name; + } + $categories[] = $term_name; + } + $xmlrpcval[’categories’] = $categories; + return $xmlrpcval; } diff -ru drupal-4.7.0-beta3/modules/profile.module howforge4703/modules/profile.module --- drupal-4.7.0-beta3/modules/profile.module 2006-01-10 02:22:04.000000000 +0700 +++ howforge4703/modules/profile.module 2006-01-12 13:19:46.000000000 +0700 @@ -393,6 +393,8 @@ foreach ($fields as $key => $field) { if ($value = profile_view_field($account, $field)) { $fields[$key]->value = $value; + } else { + $fields[$key]->value = $value; } } return $fields; diff -ru drupal-4.7.0-beta3/modules/taxonomy.module howforge4703/modules/taxonomy.module --- drupal-4.7.0-beta3/modules/taxonomy.module 2006-01-10 02:22:04.000000000 +0700 +++ howforge4703/modules/taxonomy.module 2006-01-12 13:24:49.000000000 +0700 @@ -1009,6 +1009,13 @@ */ function taxonomy_nodeapi($node, $op, $arg = 0) { switch ($op) { + case ’load’: + $output = array(); + $terms = taxonomy_node_get_terms($node->nid); + foreach ($terms as $term) { + $output[] = $term->tid; + } + return array(’taxonomy’ => $output); case ’insert’: taxonomy_node_save($node->nid, $node->taxonomy); break;
- sugree's blog
- 954 reads
Post new comment