Drupal 7

Recovering contrib Image module's content in upgrade to Drupal 7

photo 3 versions

Once upon a time in the Drupalsphere, there was the Image module, which was the preferred image solution for all Drupal sites. It dynamically resized images for display, so you could upload one image and get other sizes. But it was limited to one image per node, which made it hard for situations where you wanted to insert several images into one article. All kinds of workarounds emerged, but it was all a bit kludgey. It was nice to have something, but people were looking for something better. When Imagecache came about, it was received with much excitement, and it soon took over as the preferred image handling solution for Drupal, because you could attach several images to a node, and because it was much more performant and scalable. When Drupal 7 was in development, this functionality was considered so essential that Imagecache was incorporated into Drupal 7 core and renamed "Image". (Yeah, it can be a bit confusing if you don't know the history.)

If you were riding Drupal through those image solution shifts, it could be a bit of a rough go. In my upgrades over the years, I lost my Image node-generated posts. They were there from 2006-2007, but my upgrade to Drupal 5, when I adopted Imagecache for my images, left them adrift. I had figured those posts were doomed to obscurity, with no hooks to pull them out of database obscurity. Oh, you could see the text, but the images were gone. And if you tried to edit the node, you got no node edit form, just a blank page. I wasn't going to try to fix that for a handful of posts. I figured I just had to write them off, sacrificed at the altar of progress.

I was wrong.

I recently discovered that this content loss due to Image module deprecation has a solution. When I first saw this, I guessed it was too late for me, as I should have done this in a previous Drupal upgrade, ideally when I made the initial jump away from the Image module.

But I thought, what the heck, give it a try!

Field Converter module

It was this module I found myself looking at that got me excited.

A framework for non-CCK modules to use to convert their Drupal 6 custom data to Drupal 7 FieldAPI fields....

...Currently, Image and User terms are using this framework to migrate their data to fields on Drupal 7.

Ooh! Maybe I can rescue my Image nodes after all!

I started digging around, and learned that there is really no documentation on this. You have to read the code and figure it out.

I went to look at the old Image module in contrib, where it said on the project page:

Upgrading ... from Drupal 6 to 7: Image node data may be converted to Image fields using Field convert module; the image_legacy module (in this project's git repository's 7.x-1.x branch) provides the necessary field conversion information.

Nice! Obviously I couldn't simply enable image.module, as it would conflict with the core module's namespace. So I looked for documentation, but didn't find any there, either. I explored the Image module issues, and found Image module migration, a critical open issue with lots of discussion on just this migration need. There I saw more mention of the image_legacy module, which, as it turns out, is a module within the Image module package. People were saying it was working, albeit with issues.

Hmmmm. I had the basic elements to give this a try. I made my backups and hunkered down in my dev environment for a potentially long session.

responsive pattern

HTML drawing by Laura Scott

It was 2001 when I first started blogging. It would be a few years before I heard the word "blog", so maybe my early endeavor in online journaling wouldn't count for purists, but I was journaling online. This was a rather introspective period in my life and I felt compelled to my thoughts and experiences in this worldwide web I'd been playing with for several years. So I hand-coded a site, a static HTML affair that I had to update completely every time I posted an update. (I didn't really care for the limitations of the various services out there.) Over the next year and a half, the site grew in size, making my deployments more complicated. The blog also became collectively more and more emotionally raw, until one day, in a fit of mortified embarrassment and disgust, I deleted the whole thing and didn't look back. So yes, I started blogging eleven years ago, but I haven't been blogging for eleven years.

In 2004 I started doing some ranty blogging with a political slant, and I've continued that over the years, pseudonymously, first on Blogger, then on a Drupal site I built myself (my first, actually). Chalk it up to political cynicism fatigue that I have scarcely looked at that site in quite some time. It's hard for me to allow myself to get worked up over political issues, especially when our politics are so broken. It's an emotional space I don't care for. It drains me. I remain engaged politically, but my engagement no longer includes political blogging. That may change in the future. Who knows?

This blog I started in October 2005 to blog about stuff that interested me. Those were interesting times in 2005. I was still absorbing the profound changes technology was effecting on our culture and in our daily lives. I'm still absorbing it, actually.

So, in technical terms, my online life has shifted from a self-built flat html site to a saas blog to some self-built blogs, commercial sites, and communities.

Over the last couple of years, the foci of my sharing compulsion have gradually shifted towards Twitter, Google+, Facebook, Tumblr, and the like. The interconnectedness of these networks is what appeals. It's what works better now for quick sharing, sad to say, and it's what I feel is more indicative of trends in the future.

So why spend time going back and updating this blog? It's a silo, for the most part. A year or so ago I tried an experiment ameliorating that feeling by replacing the Drupal comments system with Disqus comments, and I think that has helped make this feel less like a silo, more connected. People who have never seen this blog can follow a link and find that they are already logged in to share a thought in the comments. Others can log in using any of a number of existing accounts elsewhere. Identity management wins (albeit in the proprietary realm).

This blog is also my home, in a sense. I feel a responsibility to maintain its upkeep. And part of that is progressing with the rest of the Drupal community. I share in this fabulous commons, and the drop is always moving. I must keep moving, too, even for this oft-quiescent blog.

Drupal 7 freeze means time for a new tag: #D7DX

Yeah? Maybe?

[update: maybe not. see comments.]

#D7UX [Tweeted] is about Drupal 7 user experience work.

#D7CX [Tweeted] is about upgrading Drupal contrib modules to stable Drupal 7 releases when Drupal 7 itself is released. Over 100 contributed projects now bear this commitment, which is just awesome!

To me, that leaves #D7DX – a focused effort to get some rockin' Drupal 7 design themes going.

Yes, we have #D4D. And beautiful Drupal 7 themes are part of #D4D. But #D4D is also about Design 4 Drupal events, broader #d4d efforts on Drupal.org, and other design efforts that are happening. But why not a more focused tag, not on making Drupal pretty in general, not on improving the designer's experience in Drupal, but focused just on creating beautiful, semantic, exciting, eye candilicious themes for Drupal 7? For core themes, yes, but also for contrib. All ready and stable by Drupal 7 official release. Now is the time!

I'm writing to myself, here, since for someone who's been working with and designing for Drupal since 2004, I'm very late to the contributed theme party. That has to change.

At any rate, it's an occasion to finally get this blog here out of the Minelli realm. That's a long overdue effort. All I need is a little free time.

Yes.

Tweet Tweet!

Email?

Get occasional email updates on what I'm doing (and not blogging about).




Powered by MailChimp

Subscribe to Drupal 7