I was recently working on a site project that combines the power of both Drupal and CiviCRM. The site consists of a custom theme (based on Fusion Core) that uses a little bit of jQuery goodness to enhance the user interface. The site is designed to allow users to create their own user accounts and set up profiles, and I keep that in mind as I theme the site. Everything was fine until I upgraded to CiviCRM 3.1.3.
To provide a few user interface enhancements, I was using Uniform and jQuery UI on this project. Both are jQuery libraries for changing the appearance of form elements such as check boxes, radio buttons, drop down lists, and buttons. With jQuery UI, I was replacing the javascript Calendar popup from Drupal’s Date module. I did all of this just to provide some eye candy to the site since it has a social networking aspect. However, I did notice a problem. After upgrading to CiviCRM 3.1.3, I noticed that when I access CiviCRM through Drupal, I get a message saying that javascript must be enabled. This is true if you wish to use CiviCRM’s dashboard feature which is not a big deal to me. However, this also breaks CiviCRM’s date popup for creating events, and it also breaks the options menu on viewing contacts. Not good.
At first, I thought that the Suckerfish menu in my theme was causing the issue. But after a little bit of searching, I discovered that the problem occurred with the jQuery form replacements that I was using. One by one, I disabled the scripts from my theme to notice that the Uniform library conflicts with CiviCRM’s javascript. Refreshing the page after disabling the script will fix the javascript problem. Similarly, the same result happened when I disabled jQuery UI. Simply disabling that script and refreshing the page will bring CiviCRM’s javascript back to life.
So in the end, I wanted my forms to look a little nicer, and I wanted to have a more colorful date popup. I’m not a javascript expert and do not know any more specifics or workarounds to have both the form elements themed and have CiviCRM working correctly. I can only say that in situations like this, it is best to have all foundational components working instead of worrying about the appearance of form elements.
By the way, there is nothing wrong with jQuery UI or Uniform. If this project was a standalone Drupal or any other CMS project, then these form element replacements would be just fine. CiviCRM does some backend functionality (mainly event registration) that is crucial for the site. Therefore, it will win in terms of getting everything working correctly. By all means, use whatever javascript/theme enhancements as you wish, but be aware of possible conflicts when using sites that rely on several working components.
