downloading a project and enabling it aftetrwards fail for a different reason on all drupal versions.

D5:

$ drush dl zen pathauto
Project zen (5.x-1.2) downloaded to /var/www/drupal-5.x-dev/sites/all/themes/zen.                                  [success]
Project pathauto (5.x-2.3) downloaded to /var/www/drupal-5.x-dev/sites/all/modules/pathauto.                 [success]

$ drush en zen pathauto
zen was not found and will not be enabled.                                                                         [error]
pathauto was not found and will not be enabled.                                                                    [error]
There were no projects that could be enabled.                                                                      [ok]
An error occurred at function : drush_pm_enable                                                                    [error]

module_rebuild_cache() and system_theme_data() read the project from the filesystem and insert a row in the system table but do not set $project->type. Second time those functions are invoked they read the info from the system table and the type is there in the project info.

D6:

$ drush dl zen pathauto
Project zen (6.x-1.1) downloaded to /var/www/drupal-6.x-cvs/sites/all/themes/zen.                               [success]
Project pathauto (6.x-1.2) downloaded to /var/www/drupal-6.x-cvs/sites/all/modules/pathauto.                    [success]

$ drush en zen pathauto
zen was not found and will not be enabled.                                                                         [error]
pathauto was not found and will not be enabled.                                                                    [error]
There were no projects that could be enabled.                                                                      [ok]
An error occurred at function : drush_pm_enable                                                                    [error]

Same reasons as in D5. In addition we are using here list_themes(TRUE) that is not the function. Need to use system_theme_data().

D7:

$ drush dl zen pathauto
Project zen (7.x-3.x-dev) downloaded to /var/www/drupal-7.x-dev/sites/all/themes/zen.                              [success]
Project pathauto (7.x-1.x-dev) downloaded to /var/www/drupal-7.x-dev/sites/all/modules/pathauto.                   [success]

$ drush en zen pathauto
zen was not found and will not be enabled.                                                                         [error]
The following projects will be enabled: pathauto, path
Do you really want to continue? (y/n): 

For modules it already works.

For themes it is also using list_themes(TRUE). Correct functions aresystem_rebuild_theme_data() and _system_theme_list(), that remove hidden projects from the listing, so to not break anything I think the former is preferable.

Patch attached.

CommentFileSizeAuthor
#1 fix-for-enabling-new-projects.diff4.08 KBjonhattan

Comments

jonhattan’s picture

StatusFileSize
new4.08 KB

removed a debugging print_r

moshe weitzman’s picture

Status: Needs review » Fixed

committed. thanks.

Status: Fixed » Closed (fixed)

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