April 2015

Always do your Data Base Updates!

I had every intention to begin reporting on my experiences during MidCamp but not long after returning to "normal" that things got busy again (with Drupal).  I am on my class reunion committee where I also maintain the website (http://ProvisoEast72.org, which I have been happy to do pro-bono for the experience) and received an email from Bob.  Apparently he is writing a book and wished to add a survey for his research. 

I have never done an online survey in Drupal before so I jumped at the chance to do it (another reason to maintain this site, it has been a growing experience being compelled to learn how to setup different functionality rather than depending on it to be out-of-the-box like you get from a distribution).  So in trying out different modules I ran into trouble.  I remember when building the site on Drupal initially (I originally build a static site then moved it to Drupal earlier this year), I had in issue with what I think was java-script where the drop down menus on the admin toolbar would not work, and after troubleshooting it unsuccessfully decided that I could live with the issue as the rest of the site functioned fine.  I had no such luck when trying to impliment Surveys. 

As a sidebar, I also decided to have 2 contact forms, one for reunion inquiries and one for reporting website issues. Unfortunately the canned Contact Form that is is Drupal Core does not handle multiple emails very well.  Though it is able to send more than one email, the visitor gets an error message and though error is turned off (because it is a production site) the error does present itself so in looking for a fix I found that there is no fix (there is added complication in that I'm usinf the SMTP Module for sending secure email through my email server and I am not going to removeauthentication from it as it has taken 2 months to get sites like GMail and Yahoo to accept my email messages after the last system hack). 

I ended up using WebForm to send my contact forms because it allows me to send the form to more than one email address without errors.  It turned out this was good timing because in my research on how to create an online survey Webform was the preferred module for accomplishing this but when I tried to use it I ran into issues with implimenting it.  I assumed that it had to do with the javascript issues I was having since it was causing the field boxes not to appear so rather than try to fix the issue I tried a couple other modules of which Survey Builder was an easier implimentation.

Once I got it working I contacted Bob and had him take a look at it but soon discovered that Survey Builder would not work in this situation because Bob needed access to the raw data and Survey Builder did not have that functionality but guess what? WebForm does so with this in mind (and because the site was not to far along I decided to rebuild it from scratch AGAIN.  I figured, at this point, it would probably be quicker than continuing spinning my wheels with trying to fix an issue that so far, leaves no trace of anything wrong or any malfuntion except for missing functionality.  Besides, I figure at my level of expertise in Drupal, it would still be good practice so I installed a new instance of Drupal (I tried cloning the site and the trouble was still there), installed and enabled the modules and rebuild the views I would need, and added the new functionality.

Unfortunately I continued to have problems with WebForm but finally discovered the source of my difficulty.  You remember the pages always stating that you should update the database AFTER you install a new module?  Well, they really mean it. <LOL>  Because I did not update the database after installing WebForm, the database tables were missing which is why functionality was missing when I was trying to use it.  Once I did the update it came up right away. 

Drush command for this is 'drush updatedb'

For Aegir the command is a little different, 'drush updb'

It's never to late to learn the basics.  If you don't learn them sooner, you'll learn them later.

Happy Drupal all.