Upon creating an installation profile, if I include colorbox in the list of modules to be enabled in hook_profile_modules, after the database is set up and the modules enabled, upon arriving at the Configure site page, javascript behavior is missing, in particular:

* When the Username field acquires focus, the E-mail address fails to copy the Site e-mail address.
* More importantly, the Clean URL test results are absent from the Server settings section and no option is available to select clean URLs.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

victorkane’s picture

Screen captures with colorbox included / not included in the list of modules

frjo’s picture

Category: bug » support

Colorbox require jQuery Update 2.x as well as the Colorbox plugin, do you have these installed?

To automate the installation of the Colorbox plugin there is an Drush command as well as a Drush make file.

victorkane’s picture

Thanks for responding so quickly!

Yes, I have all requirements fulfilled. The site is running fine (http://staging.projectflowandtracker.com/userstory/manage-business-model - click on the Conversation tab of the User story and then click on the image to see colorbox in action); I have all these same modules present for the install profile, and all modules are successfully enabled by the install profile. It's just that the described behavior continues. I did test many times, with and without colorbox. Both the required jquery update and colorbox libraries are present. Here is the list of modules (as in install profile):

function pft_profile_modules() {
$modules = array ('install_profile_api','admin_menu', 'adminrole', 'advanced_help', 'block', 'ctools', 'clone', 'color', 'jquery_update', 'comment', 'content', 'content_copy', 'bulk_export', 'ctools_custom_content', 'date_api', 'date_timezone', 'date_popup', 'date', 'dblog', 'diff', 'fieldgroup', 'filefield', 'filefield_sources', 'filter', 'path', 'help', 'imageapi', 'imageapi_imagemagick', 'imagecache', 'imagecache_ui', 'imagefield', /* issue 989590 Colorbox included in hook_profile_modules function of installation profile breaks javascript behavior of Configure site page 'colorbox', */ 'login_destination', 'menu', 'node', 'optionwidgets', 'text', 'number', 'og', 'og_access', 'og_actions', 'views', 'nodereference', 'jquery_ui','globalredirect', 'token', 'strongarm', 'system', 'taxonomy', 'nodereference_url', 'pathauto', 'update', 'user', 'userreference', 'vertical_tabs', 'og_views', 'views_attach', 'views_bulk_operations', 'views_content', 'views_export', 'views_ui', 'taxonomy_export', 'pft_basic');
return $modules;
}

frjo’s picture

Could you test the current 6-dev release?

It has some Drupal.attachBehaviors() that maybe affect this.

victorkane’s picture

Tested with latest 6.x-1.x-dev version, same results I'm afraid, no joy.

The anomaly can be recreated by downloading or cloning the 6.x-1.0-alpha1 branch from:

https://github.com/victorkane/ProjectFlowAndTracker

to obtain the complete installation profile ready to run.

Thanks!

hswong3i’s picture

Version: 6.x-1.0-beta8 » 6.x-1.x-dev
Assigned: Unassigned » hswong3i
Category: support » bug
Priority: Normal » Major
Status: Active » Needs review
FileSize
3.71 KB

I face the same problem during development and debug with our pantarei-siren install profile (http://pantarei-design.com/projects/pantarei-siren), where configuration page display incorrectly.

I figure out that:

  1. During install or upgrade, Drupal will only call drupal_maintenance_theme() (install.php line 51).
  2. drupal_maintenance_theme() will NOT include any theme override during install or upgrade (theme.maintenance.inc line 34).
  3. Therefore jquery_update for Drupal 6.x will not able to hook and replace the misc/jquery.js with corresponding newer version (jquery_update.module line 52).
  4. Finally, as colorbox depend on jquery_update, the include of colorbox's JS will result with error page rendering.

Therefore my solution is quite simple: NOT include any colorbox JS during install or upgrade page. Just with some additional case checking in colorbox_init() can solve this problem.

Moreover, colorbox is now hardcode its library default path as "sites/all/libraries/colorbox" (colorbox.module line 12) which is not install profile friendly. This can be improved with the use of Library API (http://drupal.org/project/libraries). This patch also include such changes as suggested to reCAPTCHA module (http://edin.no-ip.com/blog/hswong3i/patching-drupal-recaptcha-module-lib...).

Patch via colorbox-6.x-1.x-dev CVS, fully tested with pantarei-siren install profile (http://pantarei-design.com/projects/pantarei-siren).

hswong3i’s picture

Title: Colorbox included in hook_profile_modules function of installation profile breaks javascript behavior of Configure site page » Improve Colorbox as install profile and Library API friendly
hswong3i’s picture

Title: Improve Colorbox as install profile and Library API friendly » Improve Colorbox as installation profile and Library API friendly
hutch’s picture

I have tested the patch in #6 and it installs cleanly and works very well. The form_set_error message could be more explicit about what the user needs to do to resolve the issue, possibly with a link to a help page provided by a new function colorbox_help(), for those who have not read the README.
The libraries module option looks sensible, I heven't tested it in a multisite setup but I'm sure it would work there too.

hswong3i’s picture

I would like to leave the handling of error message to original author, since this may need to be update together with other else documents.

Moreover, any idea to include this patch into next beta release?

hswong3i’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
FileSize
16.77 KB

Here is an improved version target for Drupal 7.x Colorbox, with better colorbox_requirements() implementation.

Moreover, this patch also simplify some dummy error message handling, plus coding style cleanup with coder.module.

Finally, it also synchronize coding style with that of patching getid3.module with Drupal 7.x Library API support (http://drupal.org/node/173616).

thill_’s picture

Status: Needs review » Reviewed & tested by the community

Some great fixes here for those of us using install profiles, this fixes colorbox completely killing our install because the library was at profiles/
/libraries instead of sites/all/libraries where it was looking for it.

thank you for the work on this

hswong3i’s picture

A renew version for both colorbox-6.x-1.x-dev and colorbox7.x-1.x-dev. It is now included in our PantaRei Siren installation profile (http://drupal.org/project/pantarei_siren) with manual hack synchronize. Fully tested with both Drupal 6/7 fresh installation.

May someone provide a kindly review of this issue so we can get fixed within official version?

andypost’s picture

+++ colorbox.install	12 Feb 2011 04:09:17 -0000
@@ -7,29 +7,30 @@
+      $requirements['colorbox']['value'] = check_plain(colorbox_get_version());
+
+      // Check if Colorbox plugin above minimum version.
+      if (!version_compare(colorbox_get_version(), COLORBOX_MIN_PLUGIN_VERSION, '>=')) {

Suppose it's better to assign result to a variable to not execute colorbox_get_version() twice

Powered by Dreditor.

frjo’s picture

Assigned: hswong3i » frjo
Category: bug » task
Status: Reviewed & tested by the community » Needs review
FileSize
8.84 KB
10.05 KB

Here are my suggestions for patches, one for D6 and one for D7.

@hswong3i, would these work in your situation? I have taken a lot from your patches but feel that my versions are cleaner.

If you depend on the "HACK: If libraries api module is not installed but available, load it." I will add it back in.

Sorry it took so long time to review this!

hswong3i’s picture

@frjo: Thank you for your review. The "HACK" section is quite useful since during installation Library API may not even enabled yet and so not able to detect the correct library path.

I give a reroll of my origin patch from #13, with new GIT patch instruction as http://drupal.org/node/632214/git-instructions.

It is not a colorbox-specific implementation: I use this coding style for other similar patch, e.g. http://drupal.org/node/173616. Please feel free to refine my suggestion according to the needs of colorbox :D

Tested with my latest pantarei-design.com/files/pantarei-siren-7.0-dev.tar.gz, installation pass without error message.

frjo’s picture

Committed #15 to 6-dev.

frjo’s picture

Committed #15 to 7-dev.

frjo’s picture

Status: Needs review » Fixed

Patch part of beta4/beta11.

Status: Fixed » Closed (fixed)

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