The patch in http://drupal.org/node/347086 added the feature to select either Lightbox2 or Thickbox for use with Product images. And when upgrading, uc_product_update_6004() takes care of setting the default for the new uc_product_image_widget variable created by this patch, so that Lightbox2 is default (if it's installed), Thickbox next (if it's installed), and "None" if neither is installed.
However, for new installations, this variable never gets set, so "None" is the default. This leads to a lot of confusion (see for example http://www.ubercart.org/forum/support/9515/thickbox) because the Thickbox/Lightbox2 functionality does not seem to work out of the box as described by the documentation, and the radio buttons at admin/store/settings/products/edit are easily overlooked in the overwhelming sea of configuration data (besides not being referenced in the install instructions).
The fundamental problem is that, before the patch the existence of Thickbox was tested *at run time* in the theme function theme_uc_product_image(), and Thickbox was used automatically if it was installed. All the user had to do was enable Thickbox and Ubercart Product images used Thickbox. But with the current code the Thickbox/Lightbox2 choice is in a variable, which is *not* set automatically at any point, but needs to be manually set after Thickbox/Lightbox2 has been installed, so can't be done in uc_product_install(). Even if Thickbox and Lightbox2 are both already installed, Product images won't use either unless the user knows enough to drill down into the right admin menu and make a selection after installation.
I also think the menu at admin/store/settings/products/edit needs to be changed to make a distinction between "None" as in "No image widgets are installed" (the current meaning) and "None", as in "Don't use any image widgets, even if installed". These should be two separate states.
Attached is a patch which fixes these two things. If one or more image widgets is installed, but no widget has been chosen in the admin menu, then one of the image widgets will be used. This contrasts with the current situation where none of the image widgets will be used. (Perhaps I should also set the uc_product_image_widget variable at this point, to reflect the choice?).
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | module.patch | 961 bytes | tr |
| #1 | inc.patch | 476 bytes | tr |
| inc.patch | 476 bytes | tr | |
| module.patch | 863 bytes | tr |
Comments
Comment #1
tr commentedHere's a new version of the module.patch with the uc_product_image_widget variable being set.
Comment #2
Island Usurper commentedI was going to try to make the form have the right option selected if one of those modules is installed and they view the settings page before a product page. I had so much trouble that I decided it just wasn't worth changing.
Thanks, and committed.