Similar to the core Drupal 7 issue (#986616: Update Manager fails when the primary module/theme for a project lives in a subdirectory), pm-update (pm-updatecode, up, upc) fails to correctly update projects where the primary module lives within a subdirectory of the project. A good example is the Omega theme which contains the following directory structure:

  • CHANGELOG.txt
  • DRUPAL7.txt
  • LICENSE.txt
  • README.txt
  • assets
  • omega
  • starterkit
  • starterkit_xhtml

When the Omega project is updated using Drush it incorrectly deletes all of the files from sites/all/themes/omega/omega and then downloads the full package to sites/all/themes/omega/omega, leaving the base theme at sites/all/themes/omega/omega/omega.

Given that Drush supports Drupal 5, 6 and 7 we can't just defer to the Drupal 7 core patch from #986616 as we'd like the fix to work on all versions, so we're left re-implementing the fix in _pm_get_project_path().

Comments

himerus’s picture

subscribe

jonhattan’s picture

Version: All-versions-4.x-dev »
Status: Active » Fixed

I bet it is already fixed because now we find the path by using all extensions in the project, not only enabled ones.

Well, I've done a test:

jonhattan@jengibre:/var/www/drupal-7.0$ drush dl omega-7.x-2.0
Project omega (7.x-2.0) downloaded to /var/www/drupal-7.0/sites/all/themes/omega.                                  [success]
Project omega contains 3 themes: omega_starterkit, omega, omega_starterkit_xhtml.

jonhattan@jengibre:/var/www/drupal-7.0$ ls sites/all/themes/omega/
assets/           DRUPAL7.txt       LICENSE.txt       README.txt        starterkit_xhtml/ 
CHANGELOG.txt     .gitignore        omega/            starterkit/       

jonhattan@jengibre:/var/www/drupal-7.0$ drush en omega
The following extensions will be enabled: omega
Do you really want to continue? (y/n): y
omega was enabled successfully.                        

jonhattan@jengibre:/var/www/drupal-7.0$ drush up omega
[...]
Code updates will be made to the following projects: Omega (960gs & HTML5) [omega-7.x-2.1
[...]
Project omega was updated successfully. Installed version is now 7.x-2.1.

jonhattan@jengibre:/var/www/drupal-7.0$ ls sites/all/themes/omega/
assets  CHANGELOG.txt  DRUPAL7.txt  LICENSE.txt  omega  README.txt  starterkit  starterkit_xhtml
jonhattan@jengibre:/var/www/drupal-7.0$ ls sites/all/themes/omega/omega/
css          i    js        omega.info  process         template.php  theme-settings.php
favicon.ico  inc  logo.png  preprocess  screenshot.png  templates

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.