TNS Internal:OnRamp/moveBPPBanalysis/drupal/themeANDcontentTypes/contentOrganization/D6 D7 upgrade theme

From NSDLWiki

Jump to: navigation, search



Upgrading from Drupal 6 to Drupal 7

General upgrade process:

I followed the steps outlined at Drupal's website... Upgrading from Drupal 6 to 7

PROBLEM: While running upgrade.php, one of the required updates did not run correctly leaving the data in an unknown state.
  • Analysis: Turns out the upgrade for one module ran but didn't mark itself as completed. When it tried to run a second time, it couldn't find the old fields since they were updated. The upgrade script failed. Drupal couldn't recover from this in terms of upgrade.php completing.
  • Solution: If the upgrade process is run again, install each module one at a time. Run upgrade.php for after each module is installed.

See Validate Content section for more upgrade problems.

Theme upgrade process:

1) Get copies of...

  • zen_D6 - from original D6 zen theme
  • bppb_D6 - from current production D6 polar drupal project
  • zen_D7 - from new downloaded zen theme
  • bppb_D7 - copy of zen_D7's starter kit

2) compare bppb_D6 with zen_D6's starter kit


    • renamed from and modified -- follows is comparison with zen_D6 version
      • changed comments for name and description
      • added 2 style sheets - style.css & template.css

  • css
    • it appears that as part of the original D6 work, all zen_D6 css were deleted except...
      • pages.css
        • gutted such that the only style remaining is .element-invisible
      • style.css (copied from polar webapp)
      • template.css (copied from polar webapp)
      • print.css (copied from polar webapp) -- REPLACED zen_D6 version print.css... is this OK?

  • images/site - new dir that holds images from polar webapp

  • templates.php
    • changed name prefix from STARTERKIT to bppb
    • added a few new functions at the bottom of the file

  • templates/page.tpl.php
    • copied from zen_D6 and modified -- follows is comparison with zen_D6 version
      • print $metakeywords in <head> (not actually functional)
      • removed skip_link for primary menus at the top
      • removed printing of primary menus mid-way down page (just before printing first side bar)
      • almost completely replaced zen_D6 header div with polar webapp heading div -- need to look at this more closely while modifying this file for D7
      • commented out printing of title

  • theme-settings.php
    • changed name prefix from STARTERKIT to bppb

3) compare zen_D6 starter kit with zen_D7 starter kit


  • css
    • lots of files changed
    • 3 were deleted
    • 1 was added

  • (changes to
    • css
      • - css/block-editing.css
      • - css/panels-styles.css
    • regions
      • - content_top
      • - content_bottom
      • + content
      • - page_closure
      • + bottom
      • + page_top
      • + page_bottom
    • features
      • - mission
      • - search
      • C primary_links TO main_menu
      • C secondary_links TO secondary_menu
    • settings
      • - zen_block_editing
      • + shortcut_module_link

  • not modified in bppb, so doesn't matter
    • image-source
    • js
    • templates/README.txt
    • theme-settings.php

    • README.txt
    • screenshot.png
    • template.php

4) merge #2 diffs into bppb_D7 taking #3 diffs into account as well

  • copy zen_D7 stater kit to /sites/all/themes/bppb_D7


  • rename to
    • modify file (used eclipse 'compare' to merge)...
      • copy name and description comments from bppb_D6/
      • added 2 style sheets - style.css & template.css

  • css
    • delete all css that came with zen_D7 STARTERKIT
    • copy css/* from bppb_D6

  • copy images/site from bppb_D6 to bppb_D7

  • templates.php
    • modify file...
      • changed name prefix from STARTERKIT to bppb
      • copy bppb_links() functions at the bottom of the file from bppb_D6 version to bppb_D7 version (used eclipse 'compare' to merge)
      • modified name of new functions to have bppb prefix
        PROBLEM: bppb_links() extends zen_links() which no longer exists in zen_D7. Exploring what to do. This controls menus in the header & footer.
        • Partial Solution: changed to bppb_link() which only looks at each link to determine if the title has <br>. If it does, it removed <br> from the title and appends <br> after the </a>.
        • Still a Problem: bppb_links() also puts the | between the links. I don't believe this can be done with bppb_link. It may be possible if $variables has information on the position of the link in the menu. Resolution postponed as this isn't critical.

  • theme-settings.php
    • changed name prefix from STARTERKIT to bppb

  • templates/page.tpl.php
    • copy from zen_D7
    • modify file...
      • copy all within and including heading div from bppb_D6... paste by replacing all within and including header div
        PROBLEM: The name of the menus changed from primary-links and secondary-links to main-menu and secondary-menu, respectively.

validate content

PROBLEM: Front page displays without content.
  • Solution: Change the margin for content style from 0px to 1px.

PROBLEM: All content types are getting errors about missing fields.
  • Solution: Manage content fields and save without making any changes. Repeat this for each content type.

PROBLEM: Header and footer menu styles are using the wrong font.
  • Solution: Copied the font def from page style to each menu's style.

PROBLEM: All CCK fields are missing. Taxonomy fields are present.
  • Analysis: Drupal 6 version was reinstalled and verified that CCK fields were indeed defined and didn't upgrade.
  • Planned Solution: Planning to recreate the content types within Drupal 7 version.

PROBLEM: Science Subjects taxonomy will not display terms in taxonomy overview of terms. All other taxonomies appear correct.
  • Analysis: The taxonomy tables in the DB appear fine.
  • Possible Solution: Delete and recreate this taxonomy. The problem is that the taxonomy import module has not been upgraded to Drupal 7. This is a very long taxonomy and would take a long time to enter manually.
  • Possible Solution: Debug the code to figure out what is wrong. modules/taxonomy/ -> taxonomy_overview_terms(). This could be time consuming.
  • POSTPONE: For now, this is not being resolved in order to make progress in other areas. Perhaps the tools that would aid in the resolution will be upgraded by the time this problem is re-evaluated.

Thoughts on improvements


Use code from Fez to create a facility for logging errors. This will greatly help with debugging the php code. Question: Does Drupal have something like this and I just haven't found it yet?

Using devel for Logging

Personal tools