Drupal Ace: Now with Drupal 7!

18 May 2013

You may not realize it when it happens, but a kick in the teeth may be the best thing in the world for you. – Walt Disney

It just wouldn't be a picnic without the ants. — Author Unknown

Troubles. Adversity. These are the tests that wake us from complacency, allowing us to see the good around us. So it is, too, with the update from Drupal 6 to 7. Struggling through the update's attendant troubles, a Drupal user is rewarded in the end with a renewed appreciation of a true wonder of the Web:

WordPress.

But. While it's true that I've migrated a simple site or two to WordPress for learning purposes, it would hardly be kosher for a site called Drupal Ace to run on a platform sans pointy-headed mascot. So. After much delay and hesitant tests, I've finally moved this site to Drupal 7. And it works!...

...sort of. Here's a very shortened look at some roadblocks I hit, and some of the weirdness that remains in the D7 site:

Errors and problems in the upgrade (or, "Gee, what a surprise")

I performed all the normal preparations for performing the upgrade from D6 to D7, including creation of an operating clone of the D6 site that will keep running (shielded from the public) after the upgrade. (The purpose being, of course, to let me go back to an operating D6 site as needed to confirm how things are supposed to work on the D7.)

I input the launch code that fires the nukes (i.e., "update.php"). Drupal reponded with a loooong list of inscrutable red-text protests, which I didn't take much note of at first; I focused on the error below, something new to me:

Uncaught exception thrown in session handler.
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ssid' in 'where clause': SELECT 1 AS expression FROM {sessions} sessions WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => uUdACD2Qem2wRBqVrPw1f1 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 209 of /home/directory/Drupal/includes/session.inc).

Well. That's a fine how-do-you-do in the morning. Fortunately, a web search reveals a lot of discussion of this issue, with many suggestions centering on editing the my.cnf file to change max_allowed_packet from 1M to 16M. Sadly, I can't do this with my hosting service.

Another suggestion: Use the Schema module to inspect and clean up problems in the D6 database. While documentation for doing so is sparse, I was able to use the module to learn the following at admin/reports/status:

Database schema
Inconsistent
The Schema comparison report shows:
 •    25 modules with matching tables
 •    161 extra tables
 •    1 warnings
 •    3 module with mis-matching tables
The database schema comparison report provides more details.

Hmm, that can't be good. Looking at the module (sic) with mis-matching tables, I saw that they were all unimportant and unneeded for both my D6 and D7 site. Rather than work on a fix, I made sure the modules were uninstalled in D6 and not present in D7 – in fact, I made sure all unneeded modules were fully uninstalled, not just disabled – and then I dropped the offending tables from the database. That made my Schema report all happy (no mis-matching tables!), but not update.php: the latter again spit out

Uncaught exception thrown in session handler.

...

just as above.

Update obstacle removed!

I decided to take a closer look at the longer, red-text stream of errors that I mention above. I should have copied the text or made a screen shot to show here; sorry, that text is gone. But I was able to find precisely one recognizable entity among its jibber-jabber, right near the top: mention of an SEO module. That was a wee mysterious, as said D6 module was first disabled and then uninstalled during my above trials. So out of curiosity, I looked in the D7 installation, found some sort of unused SEO module sitting in the user-installed modules directory, and deleted it. I tried update.php, and...

... it worked. Huh.

So, the takeaway: If you find yourself facing that "Uncaught exception thrown in session handler error" during an upgrade, and the fixes suggested by experts don't work, search the error text carefully for mention of modules. See whether the removal of said modules from the update installation (D7 in my case) doesn't fix things. It worked for me. This once, anyway.

The state of the update

So. Drupal Ace was up and running in D7. With lots left to do. A sampling of delights:

Things fixed

  • Except for the "home" icon at left and user name and "Log out" at right, my administration toolbar – that black bar at the top of a D7 screen – was blank. No admin menu items. From this Drupal.org thread, the fix that worked for me was: 1) execute DELETE FROM menu_links WHERE module = 'system' as a SQL command in phpMyAdmin; 2) visit admin/config/development/performance and clear cache.
  • All comments on the updated site showed ugly HTML tags. Seems that the text format in admin/config/content/formats was getting its "Display any HTML as plain text" checkbox on. Please don't do that, site.
  • I had to completely re-do page title tokens in admin/config/search/page-title. The format for these appears to have changed in Drupal 7.
  • My Blocks form showed no "demonstrate block regions" control. Seems the Help block must be enabled for this to appear. (Who knew...)
  • Many other miscellaneous settings, such as the text format settings for specific roles, were lost and needed to be redone.

Things still weird

  • A big one: On this newly updated site, "Manage display" for a content type offers check boxes for custom display settings (Teaser, etc.), but offers no access to those settings.  For example, in admin/structure/types/manage/blog/display, I can check "Teaser" as a custom display option, but there's no link to take me to the display settings for teasers. I have to do it manually, by adding "teaser" to the path: admin/structure/types/manage/blog/display/teaser. Why is there no link to do this??
  • The widget created by the Add to Any module shows up in my teasers, even though my Add to Any settings command it to not do so.
  • Read More links appear at the end of teasers even when there's no more content. (Granted, teaser and "read more" link behavior have always been troublesome for me in Drupal.)
  • I can't add things to my shortcuts toolbar in the normal way. Admin pages offer no little "add to shortcuts" widget. Is this some simple configuration item I'm missing?
  • A final big one: I have blog entries and lots of other content promoted to the front page, which of course extends to many, many pages. And normally, Drupal places these in order of creation: newest content at the top of page 1, older content appearing in order under that. But for some bizarre reason, any new or edited node on this updated site appears at the end of the front page queue, behind older nodes! This very node is appearing at the top of page 1 (as of this writing) only because I made it sticky. You'll see that the next piece of content on the front page is old; newer content is toward the end of the queue. Utterly bizarre. I'm having to manually edit and save every single node to make it appear in proper order. It's going to take some time...

Images of pain

  • I gave up on trying to bring over the D6 site's Image nodes into this D7 site. I'm manually editing every relevant node to add an image. I have to edit every node anyway (see above weirdness), so there's that... but still, the lack of a simple upgrade path for Image nodes is a big and well-known pain.
  • More image-related pain: On the new D7 site, I have to add and configure an Image field for each content type. (It's an understandable pain, though, I'll grant; whether a node type has an Image field is arguably not something D7 should decide on its own.)
  • So. I add an image to a node through the browse and upload process, and then see I need to add that same image to a dozen other nodes. No problem; for each node, I'll just select the image from among the previously uploaded images, right? Wrong. There's no media browser for uploaded images; I have to browse and upload the same image each time for each node. This seems ill at ease with the concept of "content management system." (I wouldn't be surprised if there is a module to add such a media browser; anybody know?)
  • There's of course another way to add images: insertion directly into text, using a media browser like IMCE. All you have to do is click... and click, and click, and click, and click... (With every click required to place an image in Drupal, I hear the echo of a siren's call: WordPress... WordPress...)

The good

Shutting out the troubles and pain for a moment, there is the good of Drupal 7 to enjoy too. Lots of it. But I'll save that for later; I'm running long and I have a lot of nodes demanding edits.

I'll point to one little nicety: the awesome Bamboo theme by Danny Englander. You're seeing it in action right here.

You?

Fellow Drupal non-experts! How are your Drupal 7 updates going? (More smoothly, I hope!)

Add new comment