The install instructions are really odd.

3. Copy the new color.module in /color. Disable color.module. Now click the "Uninstall" tab and fully uninstall color.module. Re-enable. This will insure the installer is hooked and that the tables are properly created.

The grammar is attrocious, but I'm reading it as…

  1. If you've got the original color.module installed, disable it.
  2. Then copy the new color_soc08 to your drupal installation.
  3. Now click the "Uninstall" tab and fully uninstall color.module
  4. Re-enable.

But when "uninstall" I get these errors:

  • user warning: Unknown table 'color' query: DROP TABLE color in includes/database.mysql-common.inc on line 261.
  • user warning: Unknown table 'color_schemes' query: DROP TABLE color_schemes in includes/database.mysql-common.inc on line 261.
  • warning: Invalid argument supplied for foreach() in sites/all/modules/color_soc08/color.install on line 57.

So it looks like you don’t need to uninstall the old color module.

What was the original rationale for having this uninstall step in there? That step seems completely unnecessary.

Comments

johnalbin’s picture

Correction:

  1. If you've got the original color.module installed, copy the new color_soc08 to your drupal installation.
  2. Then disable it.
  3. etc…
tonyn’s picture

Status: Active » Fixed

Gotcha.

Updating that, because it's just giving people errors.

Thanks!

tonyn’s picture

Status: Fixed » Postponed (maintainer needs more info)

Oops. One moment.

We uninstall it because we need to use the hook_install to make the new tables. Hook_install() does the schema editions.

Will enabling/disabling like this still do the hook_install()? In for disabling/enabling, we don't want to fully uninstall.

What would could do with hook_enable is check to see if the schema is existing and correct, perhaps?

johnalbin’s picture

Status: Postponed (maintainer needs more info) » Active

Actually, rather then messing with hook_enable and checking the schema, we should be using hook_update_N(). Then users would just need to install, enable and run /update.php.

I have a really simple patch sitting on my computer that adds that function, but the #324502: Code cleanup patch touches too many lines to not conflict with this patch, so I'll post this patch later.

Once hook_update_N is added to color.install: If a user has never used or enabled the original color module, the code in color_install will install the db schema and Drupal will set the internal revision of color module to the highest N numbered hook_update_N function. If a user has already enabled the original color module, Drupal won't run color_install(), but instead the user will need to run /update.php so that the hook_update_N function is run and that function will install the db schema.

tonyn’s picture

I'm applying that patch now, so we can get working with that codebase.

Also, I pondering changing the installation instructions to:

========================
INSTALLATION AND USAGE
========================
  This will ensure the installer is hooked and that the tables are
  properly created.

  1. Backup your current /themes and /modules/color folders. Move them elsewhere
     temporarily.
  2. Place the themes in the /examples folder Drupal theme folder.
     *Make sure to keep your /themes/engines folder in the theme folder!*.
  3. Go to modules page. Disable current color.module. 
     If possible, Uninstall.
  4. Copy the new color.module in /color.
  5. Enable.
  4. Then you can choose to enable/generate color schemes on a per theme basis.
mdupont’s picture

Any news on this?

mdupont’s picture

Status: Active » Closed (won't fix)

Seems like this module is deprecated and won't longer be developed.