Date and Calendar in Drupal 7

I have to wonder how many of those early release books written for Drupal 7 will end up becoming trash. I’m sure they will contain useful information but things are still changing. I discovered a good video titled Date + Calendar from the Drupal Therapy guys and decided to work through their example. It goes through the steps of installing the Date and Calendar modules then creating a new Event Content Type.

The problems started when I got to the steps they lay out for configuring the Date’s Views. It was helpful while frustrating because the Views settings page has changed so much. I finally got through the Views configuration without error messages and got the Calendar to display the correct date. As suggested, I replaced the downloaded Views, Calendar, and Date with the most recent Dev versions.

In the Administration->Structure->Views page for Calendar (Content) the page layout has changed substantially from the Feb 11, 2011 date the video was originally produced (not too surprising). There is not a Defaults selection or Arguments selection on the configuration page anymore.

I made three changes:

  • Replaced the values in CONTEXTUAL FILTERS with – “Date: Date (node) (Content: Date (field_date))
  • Under FIELDS set values to – “Content: Date (Date)
  • Under FILTER CRITERIA set values to – “Content: Published (Yes)” and “Content: Type (= Event)

My problem now is after the Event is published the Date and Body only show up when I select the web site’s home page. If I click on the Event article to view or edit, the published Date and Body disappear. Is anyone else having that trouble or know of a solution? (I do have Organic Groups installed in this site too if that matters).

 About SomeoneKnows 
(c) 2011 Vince Thompson

A Closer Look at Drupal 7

I use Google to find many of the things I want to learn about. Sometimes the list of links it returns can be a little disappointing. Upgrading from Drupal 6 to Drupal 7 is one of those situations that is bringing a variety of results that don’t quite hit the mark. Of course what I’m finding today will change in the days and weeks to come so your experiences will vary. I hope to continue updating this article as I find more useful information.

Sometimes the most obvious places get overlooked. For instance, the Upgrade.txt file in the Drupal7 installation is a good place to start looking. Here are some other good places I’ve started looking:

From the Drupal Handbook Documents Administration Guide look at these sections:
After you get a fundamental Drupal 7 installation working the following guides are helpful:

Database API

I haven’t found a nice pushbutton solution to upgrading the databases between D6 and D7. Diving into relevant database documentation is the best choice as I can see it right now.

Links Found That May Be Useful? 

I haven’t read the following articles yet but they may have some useful information so I’m bookmarking them here for now:

Database Migration

 About SomeoneKnows 
(c) 2011 Vince Thompson

Drupal 7 – Are We There Yet?

When I started picking up on Drupal I began learning about Drupal 6 because Drupal 7 was off in the distant future. Well, Drupal 7 was released for production on Jan. 5 this year and I’ve still been in the “sometime in the future mode” until the last few days (peeling back the onion some more) Now, work has begun on Drupal 8 to be released sometime in the future.

Drupal 7 has some features that make sense for a new web site I’m working on – Organic Groups and Web Services. While these aren’t new they have some updates to the way they work. The CCK and Views have been two of the most important modules for Drupal 6 web sites. It appears that Drupal 7 now replaces them with Fields. Drupal 8 is planned to include some features I want to design for like incorporating a higher degree of web services. I ordered another book that should arrive today, this one about Drupal 6 Web Services. I see web services as an important component in connecting interactions between Drupal and MicroStation, AutoCad or other future CAD/CAE systems. Since I’m starting off with a new web project is seems like the best time to jump into Drupal 7 development.

Using Git to Download Drupal 7

I don’t understand enough about Git yet but was able to use it and get a copy from the Drupal Git repository. I was worried about making mistakes in setting up my local repository like where it should reside how can I undo a mistake. I made a few mistakes along the way and learned they could be erased by deleting the “.git” folder. If it turns out I overlooked something about erasing a repository I’ll add more information here. This article seemed to be helpful: I managed to get a local site working with Drupal 7 last night.

I got a rudimentary install with Organic Groups and several other features set up within a Drupal 7 environment. So far, so good. Something I could use some help with is finding out what the recommended practice are to take the MySql database from its Drupal 6 configuration to Drupal 7. My initial search didn’t come up with a worthwhile suggestion yet. Maybe I’m just not looking in the right place.

 About SomeoneKnows 
(c) 2011 Vince Thompson

Drupal Taxonomy

Drupal has an unbelievable collection of features. So much of the time I feel like I’m constantly peeling away different layers of an onion trying to get to an understanding of what it does and how to make it work. It is designed to separate the programming code from the information. The information – things like labels, values for check boxes, radio buttons, or selection lists gets stored in the database while modules provide the programming framework. Drupal is a true database driven system

Taxonomy reinforces this separation of programming features from the information (data) and what it means. If  you’re spending some time learning about Drupal I thought you might find the following video interesting to watch. It is a bit long around 50 minutes but it does make some good points about taxonomy and how its used.

Setting Up an IDE for Drupal Development

I founded a group in Kansas City called Make:KC in July 2009 inspired by Make Magazine, their Maker Faires, and the web site. I started with a MakeKC WordPress blog using WordPress’ free blogging site. Then I registered our domain name and started using Drupal in December 2009. Make:KC is a non-profit organization.

I’ve tried setting up an Integrated Development Environment (IDE) using Eclipse and then NetBeans. Both seem to work well as editors but I was having trouble getting a debugger working that would allow me to step through the PHP commands on our web site. Most of the time these tools have not been needed while using Drupal’s menu style configuration. But I’m wanting to work on developing some modules too.

NetBeans and xdebug

I tried to get debugging working for Drupal sometime last year. At that time I tried Eclipse and NetBeans. I’m spending more time learning to develop in Drupal so I need this to work. It helps to step through commands with a debugger and learn what takes place in Drupal’s code; learning why, how, and when commands are executed.

I’m sure Eclipse is a great IDE to work with but I managed to get debugging working in NetBeans first. I had an older version already on my computer but installed the newer NetBeans 7.0 version today and now I have debugging working on the server side.

I had already downloaded the xdebug program but setting it up to work with the IDE was my problem. I found this web site with some answers I needed:
The section about adding the following instructions to my /etc/php5/apache2/php.ini file seemed to make things work:


; Remote settings

; General

; Trace options

; Profiling

I need to read the article “Introducing xdebug”, it looks like it has some really good information:

 About SomeoneKnows 
(c) 2011 Vince Thompson

Our Drupal Site Backed Up to a Laptop

Putting on a Laptop

I have been spending time lately learning more about Drupal. The more I learn, the more I’m impressed with the system so I decided to write this up and post it to my blog.

I’ve wanted to have a local copy of our MakeKC live website on my home machine for testing and backup but I was having trouble getting the database installed. The phpMySql program wouldn’t let the large database dmp file load. The solution was actually simple but requires a command line keyin in the form:

mysql -u username -p databasename < backupfilename.sql

or in my case:

mysql -u makekcAcct -p databaseForMakekc < myHostingAcct-databaseForMakekc-4-25-2011.dmp 

I copied all of the files from’s drupal6 directory down to my local machine. I have Ubuntu with Apache, PHP, and MySql installed. I copied the directory to my computer at:  ~home/www/makekc.local/drupal6 (where ~home is the shortcut notation for my home directory).

I added the a static IP address to the /etc/hosts file    localhost    makekc.local

(I happen to be using other ip addresses and the next in line was at the time).

A Revelation About Website Root Directories

I’m using the versions of Apache, PHP, and MySql offered by Ubuntu’s Synaptic Package Manager. This causes my web site files to be placed off the root directory at /var/www/myVirtualDomains. Up until now I thought each of my local web sites had to go into the /var/www/ directory for special web site purposes. I wondered if pointing to a different web root directory inside my home directory would work. So I added the following to my /etc/apache2/sites-enabled/000-default file:

<VirtualHost makekc.local:80>
   ServerAdmin webmaster@makekc.local
   DocumentRoot /home/someoneknows/www/makekc.local/drupal6
   ServerName makekc.local
   ServerAlias www.makekc.local
   ErrorLog /var/log/apache2/makekc.local-error_log
   CustomLog /var/log/apache2/makekc.local-access_log common

Turns out it that pointing to a web root directory in my login account works there too.

With the website files and the web server configuration in place I restarted the server. Then navigated to the web page using makekc.local. The same homepage from the live website was showing up on my makekc.local site too. But when I tried logging in or going to one of the links in the site they didn’t work.

Enabling Clean URLs

I finally realized that the links to other pages probably weren’t working because Clean URLs are enabled on the live site but my default apache installation didn’t allow my Drupal install to Enable Clean URLs.  I didn’t take the time to learn how to apply the proper configuration at the time for my laptop computer to allow mod_rewrite to work.

It took a while but I finally found the command “sudo a2enmod rewrite“, this sets up apache to allow rewrites to happen. Then I changed the /ect/apache2/sites-enabled/000-default file again to change AllowOveride  None to AllowOverride All as in:

   <Directory />
       Options FollowSymLinks
       AllowOverride All

After restarting Apache again I finally have a working local copy on my computer with the same contents and functionality as our live site.

 About SomeoneKnows 
(c) 2011 Vince Thompson