<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Coffee|Code : Dan Scott - Libraries</title>
    <link>http://www.coffeecode.net/</link>
    <description>Caffeinated Librarian Geek</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.6.2 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Making the Evergreen catalogue mobile-friendly via responsive CSS</title>
    <link>http://www.coffeecode.net/archives/265-Making-the-Evergreen-catalogue-mobile-friendly-via-responsive-CSS.html</link>
            <category>Coding</category>
            <category>Evergreen</category>
    
    <comments>http://www.coffeecode.net/archives/265-Making-the-Evergreen-catalogue-mobile-friendly-via-responsive-CSS.html#comments</comments>
    <wfw:comment>http://www.coffeecode.net/wfwcomment.php?cid=265</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://www.coffeecode.net/rss.php?version=2.0&amp;type=comments&amp;cid=265</wfw:commentRss>
    

    <author>dan@coffeecode.net (Dan Scott)</author>
    <content:encoded>
    &lt;p&gt;Back in November the Evergreen community was discussing the desire for a mobile catalogue, and &lt;a href=&quot;http://markmail.org/message/tdvihpd63lu6ksbs&quot;&gt;expressed a strong opinion&lt;/a&gt; that the right way forward would be to teach the current catalogue to be mobile-friendly by applying principles of responsive design. In fact, I stated:&lt;/p&gt;
&lt;blockquote&gt;
Almost all of this can be achieved via CSS, possibly with some changes to the underlying HTML (e.g. tables to divs or whatever so that &quot;Place Hold&quot; appears under the bib info instead of way over to the right).
&lt;/blockquote&gt;
&lt;p&gt;I have this bad habit of talking more than doing. So when I saw the Beanstalk mobile catalogue resurrected again at the Evergreen 2013 lightning talks, it bugged me that I still hadn&#039;t put any effort into a proof of concept of what was possible with &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/CSS/Media_queries&quot;&gt;CSS media queries&lt;/a&gt;. Thus, today, on the last day of my holidays, I spent a few hours trying things out on our development server and came up with &lt;a href=&quot;http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dbs/responsive_tpac&quot;&gt;this &lt;em&gt;rough&lt;/em&gt; branch&lt;/a&gt; to work towards making the exact same HTML that we serve up for desktops provide an experience similar to that of the Beanstalk generation of catalogues for mobile, just via CSS.&lt;/p&gt;
&lt;p&gt;As you can see from the commits, I made one change to the HTML to define a viewport, and added one set of CSS rules wrapped in a media query; in essence:&lt;/p&gt;
&lt;pre&gt;
...
&amp;lt;head&amp;gt;
...
&amp;lt;meta content=&quot;initial-scale=1.0,width=device-width&quot; name=&quot;viewport&quot;&amp;gt;
&amp;lt;style&amp;gt;
@media only screen and (max-width: 600px) {
    #header {
        padding: 0px;
        margin: 0px;
    }
    .facet_sidebar {
        display: none;
    }
    ...
}
&amp;lt;/style&amp;gt;
&amp;lt;head&amp;gt;
...
&lt;/pre&gt;
&lt;h4&gt;Results and trade-offs&lt;/h4&gt;
&lt;p&gt;Here are a few example URLs from our test server (which is slow, and might get wiped any day, so test them quickly if you have a mobile device around!):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://laurentian-test.concat.ca/eg/opac/results?query=open+source&amp;qtype=keyword&amp;locg=103&amp;detail_record_view=1&quot;&gt;Search results&lt;/a&gt; - sacrificed facets, per-item actions, and the language picker&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://laurentian-test.concat.ca/eg/opac/record/729926?query=open%20source;qtype=keyword;locg=103;detail_record_view=1&quot;&gt;Record details&lt;/a&gt; - sacrificed per-item actions, flattened the item table vertically&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In general, I removed a lot of the frippery from the header, while trying to retain the most valuable pieces. However, some bits are broken: &lt;strong&gt;Another Search&lt;/strong&gt; doesn&#039;t actually let you do another search because the search bar is totally hidden. Other bits haven&#039;t been touched (&lt;strong&gt;Advanced search&lt;/strong&gt; is still overwhelming, and &lt;strong&gt;My Account&lt;/strong&gt;, while functional, could be much prettier.&lt;/p&gt;
&lt;p&gt;What I&#039;ve done so far is oriented towards our 2.3-ish lightly customized Laurentian skin (we force full details in search results, for example) but the principles should be applicable to an out-of-the-box Evergreen catalogue. In working through some of the challenges, I&#039;ve determined that I was pretty much on target back in November; with a few HTML tweaks that would improve the layout for desktops as well, we could keep the per-item actions and facets around, but just move them to a different location.&lt;/p&gt;
&lt;h4&gt;Less talk, more action&lt;/h4&gt;
&lt;p&gt;So who&#039;s with me? What we have to gain is a single set of HTML to support for TPAC, and a single set of CSS, all available from the same URL, rather than trying to maintain overlays and monkeying about with mobile-vs-desktop URLs and the like. Feel free to dig in and start pushing branches with improvements over my rough attempts and let&#039;s make this thing happen for Evergreen 2.5.&lt;/p&gt;
&lt;h4&gt;With thanks to Firefox...&lt;/h4&gt;
&lt;p&gt;I would be remiss if I did not mention the marvellous &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_View&quot;&gt;Responsive Design View&lt;/a&gt; introduced in Firefox 15, along with the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Tools/Style_Editor&quot;&gt;Style Editor&lt;/a&gt;; together, these tools (built into Firefox) made my developing and testing work &lt;em&gt;so&lt;/em&gt; much easier.&lt;/p&gt;
&lt;p&gt;If you want to live on the cutting edge of Firefox, you want Aurora - go and get it &lt;img src=&quot;http://www.coffeecode.net/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://affiliates.mozilla.org/link/banner/36536&quot;&gt;&lt;img src=&quot;http://affiliates.mozilla.org/media/uploads/banners/6f0132062588b248d44968734668226f9c19d994.png&quot; alt=&quot;Download Aurora&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 21 Apr 2013 22:48:40 -0400</pubDate>
    <guid isPermaLink="false">http://www.coffeecode.net/archives/265-guid.html</guid>
    <category>coding</category>
<category>evergreen</category>

</item>
<item>
    <title>Structured data: making metadata matter for machines</title>
    <link>http://www.coffeecode.net/archives/264-Structured-data-making-metadata-matter-for-machines.html</link>
            <category>Coding</category>
            <category>Evergreen</category>
    
    <comments>http://www.coffeecode.net/archives/264-Structured-data-making-metadata-matter-for-machines.html#comments</comments>
    <wfw:comment>http://www.coffeecode.net/wfwcomment.php?cid=264</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.coffeecode.net/rss.php?version=2.0&amp;type=comments&amp;cid=264</wfw:commentRss>
    

    <author>dan@coffeecode.net (Dan Scott)</author>
    <content:encoded>
    &lt;p&gt;&lt;strong&gt;Update 2013-04-18:&lt;/strong&gt; Now with &lt;a href=&quot;https://archive.org/details/Microdata&quot;&gt;video of the presentation&lt;/a&gt;, thanks to the awesome #egcon2013 volunteers!&lt;/p&gt;
&lt;p&gt;I&#039;ve been attending the &lt;a href=&quot;http://eg2013.evergreen-ils.org&quot;&gt;Evergreen 2013 Conference&lt;/a&gt; in beautiful Vancouver. This morning, I was honoured to be able to give a presentation on some of the work I&#039;ve been doing on implementing linked data via &lt;a href=&quot;http://schema.org&quot;&gt;schema.org&lt;/a&gt; in Evergreen. I &lt;em&gt;think&lt;/em&gt; I did a good job of explaining the potential value of linked data and arguing for improving Evergreen&#039;s schema.org publishing ninja skills.&lt;/p&gt;
&lt;p&gt;My slides, with a reasonable number of useful speaker notes to provide context, are available in &lt;a href=&quot;http://www.coffeecode.net/uploads/talks/2013/structured_data_matters.odp&quot; title=&quot;structured_data_matters.odp&quot; target=&quot;_blank&quot;&gt;LibreOffice format&lt;/a&gt;.&lt;a href=&quot;#fn1&quot;&gt;[1]&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In addition, the amazing organizers of the conference also streamed most&lt;a href=&quot;#fn2&quot;&gt;[2]&lt;/a&gt; of the talk and the recording will be available on the &lt;a href=&quot;http://eg2013.evergreen-ils.org&quot;&gt;conference web site&lt;/a&gt; in a week or two.&lt;/p&gt;
&lt;h4&gt;Footnotes&lt;/h4&gt;
&lt;ol&gt;
&lt;li id=&quot;fn1&quot;&gt;I felt pretty dirty not using HTML5 + RDFa Lite to actually mark the whole thing up; there was some question close to the time of the conference as to whether anything but PPT or perhaps PDF would be an acceptable format... a concern that was subsequently removed, but a little too late to be worthwhile changing course.&lt;/li&gt;
&lt;li id=&quot;fn2&quot;&gt;The room was standing-room only (well, sitting-on-the-floor-room only), and one of the organizers accidentally sat on and unplugged the Ethernet cable, so something like ten minutes were lost. Heh!&lt;/li&gt;
&lt;/ol&gt; 
    </content:encoded>

    <pubDate>Fri, 12 Apr 2013 15:11:47 -0400</pubDate>
    <guid isPermaLink="false">http://www.coffeecode.net/archives/264-guid.html</guid>
    <category>coding</category>
<category>evergreen</category>

</item>
<item>
    <title>Introducing SQL to Evergreen administrators, round two</title>
    <link>http://www.coffeecode.net/archives/263-Introducing-SQL-to-Evergreen-administrators,-round-two.html</link>
            <category>Evergreen</category>
            <category>PostgreSQL</category>
    
    <comments>http://www.coffeecode.net/archives/263-Introducing-SQL-to-Evergreen-administrators,-round-two.html#comments</comments>
    <wfw:comment>http://www.coffeecode.net/wfwcomment.php?cid=263</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.coffeecode.net/rss.php?version=2.0&amp;type=comments&amp;cid=263</wfw:commentRss>
    

    <author>dan@coffeecode.net (Dan Scott)</author>
    <content:encoded>
    &lt;p&gt;
&lt;a href=&quot;http://coffeecode.net/archives/212-Introduction-to-SQL-for-Evergreen-administrators.html&quot;&gt;Three years ago&lt;/a&gt; I was asked to create and deliver a two-day course introducing
SQL to Evergreen users. Things went well and I was able to share the resulting
materials with the Evergreen and PostgreSQL community. Perhaps one of my
happiest moments at the Evergreen conference last year was when one of the
participants in that course, told me that many of his fellow participants were
still successfully writing SQL queries and getting work done.  Huzzah!
&lt;/p&gt;
&lt;p&gt;
Time goes by and another group, &lt;a href=&quot;http://www.ohionet.org&quot;&gt;OHIONET&lt;/a&gt;, was running into difficulties getting
started with PostgreSQL and Evergreen. They asked me if I would be
willing to give the same sort of training I had given a few years back. &quot;Sure&quot;,
I said, thinking it would be a great opportunity to polish the materials and
add some updates to cover new features in PostgreSQL and Evergreen. We also
opted to skip the travel and do an entirely virtual training session via
Google Hangouts, which worked out rather nicely (but that&#039;s a different story).
&lt;/p&gt;
&lt;p&gt;
As it turned out, I probably ended up putting about four days worth of effort
(crammed into lots of late nights, weekends, and vacation days) into
overhauling the instruction materials. But the results were worth it, in my
opinion; I&#039;m rather proud of the content, and while I believe it stands up on
its own, the guidance that I was able to provide during the live instruction
sessions was well-received by the participants.
&lt;/p&gt;
&lt;p&gt;
Thus, I am pleased to be able to offer to the broader community the latest
version of the Introduction to SQL for Evergreen Administrators, under a
Creative Commons Attribution-ShareAlike 3.0 (Unported) license.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reference documentation--30 pages introducing SQL with examples drawn from the Evergreen schema:
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/v2/introduction_to_sql.html&quot;&gt;HTML&lt;/a&gt;)
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/v2/introduction_to_sql.pdf&quot;&gt;PDF&lt;/a&gt;)
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/v2/introduction_to_sql.epub&quot;&gt;ePub&lt;/a&gt;)
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/introduction_to_sql.epub&quot;&gt;AsciiDoc&lt;/a&gt;)
&lt;/li&gt;
&lt;li&gt;Presentation:
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/SQL_instruction.odp&quot;&gt;LibreOffice Impress&lt;/a&gt;)
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/v2/SQL_instruction.pdf&quot;&gt;PDF&lt;/a&gt;)
&lt;/li&gt;
&lt;li&gt;Solutions to exercises:
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/solutions_day_1.txt&quot;&gt;Day 1&lt;/a&gt;)
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/solutions_day_2.txt&quot;&gt;Day 2&lt;/a&gt;)
&lt;/ul&gt;
&lt;p&gt;
So, a huge thanks to OHIONET for giving me the impetus to overhaul this
material, and for giving me a chance to introduce them to the wonders of
SQL with PostgreSQL, and to the inner workings of the Evergreen schema. It
was a blast! And thanks for agreeing to let me share these materials with the
broader community.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 15 Feb 2013 21:32:08 -0500</pubDate>
    <guid isPermaLink="false">http://www.coffeecode.net/archives/263-guid.html</guid>
    <category>evergreen</category>
<category>postgresql</category>

</item>
<item>
    <title>Introducing version control &amp; git in 1.5 hours to undergraduates</title>
    <link>http://www.coffeecode.net/archives/262-Introducing-version-control-git-in-1.5-hours-to-undergraduates.html</link>
            <category>Coding</category>
    
    <comments>http://www.coffeecode.net/archives/262-Introducing-version-control-git-in-1.5-hours-to-undergraduates.html#comments</comments>
    <wfw:comment>http://www.coffeecode.net/wfwcomment.php?cid=262</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.coffeecode.net/rss.php?version=2.0&amp;type=comments&amp;cid=262</wfw:commentRss>
    

    <author>dan@coffeecode.net (Dan Scott)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;http://laurentian.ca&quot;&gt;Our university&lt;/a&gt; offers a Computer Science degree, but the formal curriculum does not cover version control (or a number of other common tools and practices in software development). Students that have worked for me in part-time jobs or summer positions have said things like:&lt;/p&gt;
&lt;blockquote&gt;if it wasn&#039;t for that one summer I worked at the library for/with you using the version control software (which was my first real time ever using it) I&#039;d have been really confused in my first job after graduating&lt;/blockquote&gt;
&lt;p&gt;That kind of statement reaffirms my belief that a Computer Science degree should include some form of introduction to software development norms--you could perhaps call it &lt;em&gt;software development literacy&lt;/em&gt;. While I&#039;ve heard the &quot;sink or swim&quot; argument when it comes to having a clue about what you are expected to do when you land an actual programming job (as in, &quot;students that don&#039;t learn this on their own probably aren&#039;t going to learn it from us&quot;), I&#039;m sure that some minimal level of exposure to these norms and specific tools from future peers will help more students swim. As I am particularly interested in development within free software projects, I&#039;ve been in close contact with the Computer Science Club to try to start providing this outside of the formal curriculum.&lt;/p&gt;
&lt;p&gt;So, as part of this mission, a few days ago I gave a presentation to the Club on &quot;version control&quot;, with a particular emphasis on using &lt;strong&gt;git&lt;/strong&gt;. The turnout was low, alas; not a sexy subject, perhaps, or just the start of term, or perhaps I need to improve my marketing efforts. In any case, I believe it went well--heads were nodding and I had the complete attention of the participants for 1.5 hours while I built up a conceptual framework for understanding version control as practiced in git.&lt;/p&gt;
&lt;p&gt;I&#039;m happy to make my presentation materials available under a CC BY-SA 3.0 license; maybe you can use them and improve on them!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://stuff.coffeecode.net/2013/git_tutorial&quot;&gt;HTML slides&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://gitorious.org/intro_to_git&quot;&gt;git repo for the presentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt; 
    </content:encoded>

    <pubDate>Sun, 20 Jan 2013 08:22:51 -0500</pubDate>
    <guid isPermaLink="false">http://www.coffeecode.net/archives/262-guid.html</guid>
    <category>coding</category>

</item>
<item>
    <title>Triumph of the tiny brain: Dan vs. Drupal / Panels</title>
    <link>http://www.coffeecode.net/archives/261-Triumph-of-the-tiny-brain-Dan-vs.-Drupal-Panels.html</link>
            <category>Coding</category>
            <category>Perl</category>
            <category>PostgreSQL</category>
    
    <comments>http://www.coffeecode.net/archives/261-Triumph-of-the-tiny-brain-Dan-vs.-Drupal-Panels.html#comments</comments>
    <wfw:comment>http://www.coffeecode.net/wfwcomment.php?cid=261</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.coffeecode.net/rss.php?version=2.0&amp;type=comments&amp;cid=261</wfw:commentRss>
    

    <author>dan@coffeecode.net (Dan Scott)</author>
    <content:encoded>
    &lt;p&gt;A while ago I inherited responsibility for a Drupal 6 instance and a rather out-of-date server. (You know it&#039;s not good when your production operating system is so old that it is no longer getting security updates).&lt;/p&gt;
&lt;p&gt;I&#039;m not a Drupal person. I dabbled with Drupal years and years ago when I was heavily into PHP, but it never stuck with me. Every time I poked around at the database schema, with serialized objects stuck inside columns, I found something else that I wanted to work on instead. Thus, inheriting a Drupal instance wasn&#039;t something I had been looking forward to. As this production server was running a number of different services that were in use by our library, I went through a number of trial runs to ensure that the base packages wouldn&#039;t introduce regressions or outages. Fast-forward past a reasonably successful early-morning upgrade from Debian Lenny to Squeeze and I was able to start looking at addressing the Drupal instance that was also approximately 18 months out of date.&lt;/p&gt;
&lt;p&gt;Initially, after I worked out the how-to of Drupal upgrades (in short: upgrade just Drupal core, then upgrade the modules), I thought all was well. I even got over the hump of realizing that our instance had had all of the modules dumped into Drupal&#039;s core directory, rather than &lt;tt&gt;sites/all/modules&lt;/tt&gt;, and (even more impressively) got over the problem that the core &lt;em&gt;bluemarine&lt;/em&gt; them had been hacked directly rather than having been separated out into a new custom theme. After working through those learning pains, I realized that somewhere in all of the Drupal and module upgrades, that something got &quot;more secure&quot; and started truncating IMG links to files with spaces in them at the first space. So &quot;foo%20bar.jpg&quot; was becoming &quot;foo.jpg&quot; and we were getting 404s everywhere.&lt;/p&gt;
&lt;p&gt;Did I mention that I didn&#039;t notice this until I upgraded our production instance? Oh yes, I went through iteration after iteration of upgrades on the test server, and dutifully fixed up the problems that I found in the subset of content that I was testing against. I discovered and fixed problems like the production server content linking directly to the test server (slight copy-and-paste errors on the part of the content creators, I suppose). But I didn&#039;t notice all of the 404s, because who uploads images with spaces in their filename?&lt;/p&gt;
&lt;p&gt;Turns out, everyone else in my library does that. Of course! And from what I was able to piece together via Google and browsing drupal.org, there was supposed to be some sanitization of the incoming filenames so that spaces would be normalized, etc. But either that wasn&#039;t introduced until well after our content had been created, or my predecessor had lightly hacked one of the modules, or Drupal itself, and hadn&#039;t bothered to use a source code repository to track those customizations. So, realizing that I needed to make some bulk changes, I went at it with a two-step plan:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create symbolic links for both the truncated filename and the spaces-normalized-to-underscores filenames. Creating symlinks for the truncated filenames would fix the 404s immediately, at the cost of some clash in the intended targets; there were plenty of &lt;tt&gt;Foo illustration.JPG&lt;/tt&gt; and &lt;tt&gt;Foo info.JPG&lt;/tt&gt; pairs of files, but like the Highlander, there can be only on &lt;tt&gt;Foo.JPG&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;Munge the database entries so that all of those now apparently insecure %20-containing filenames would become underscores.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you&#039;re a Drupal user or a Drupal with Panels module user, you might know that the database schema suffers from some fairly horrible tricks being played on it. In this case, the Panels module creates a &lt;tt&gt;panels_pane&lt;/tt&gt; table with a &lt;tt&gt;configuration&lt;/tt&gt; TEXT column. Based on the name alone, it might seem odd that column is used to store the HTML content of the corresponding panel. Even odder to me is that this is not just a TEXT column, it&#039;s a column that expects a very particular structure - something like:&lt;/p&gt;
&lt;pre&gt;a:5:{s:11:&quot;admin_title&quot;;s:5:&quot;RACER&quot;;s:5:&quot;title&quot;;s:0:&quot;&quot;;s:4:&quot;body&quot;;s:639:&quot;&amp;lt;p&gt;&amp;lt;img width=&quot;225&quot; height [...]}&lt;/pre&gt;
&lt;p&gt;Ah, nothing like storing an object within a single database column. Of particular interest was the result that I had when I tested updating the column value with a basic &quot;replace(configuration, &#039;%20&#039;, &#039;_&#039;)&quot; - the panel showed only &lt;b&gt;n/a&lt;/b&gt;, presumably because the size (defined by the &lt;tt&gt;s&lt;/tt&gt; properties in the object) for the &quot;body&quot; text property was no longer a match. That would be an instance of http://drupal.org/node/926448 - so okay, clearly I had to change tactics and update the entire object.&lt;/p&gt;
&lt;p&gt;I tried quickly finding the Drupal way to do this: clearly there&#039;s an API and there must be some simple way to retrieve an object, change it&#039;s values, and update it so that the serialized object gets stored in the database and Drupal is happy. However, I couldn&#039;t find a simple tutorial, and trying #drupal on Freenode was unfortunately fruitless as well (although some people did try to suggest running REPLACE() at the database level, that was nice but they didn&#039;t recognize that that would actually damage things significantly).&lt;/p&gt;
&lt;p&gt;So... out came the Perl, and here&#039;s what I hacked together:&lt;/p&gt;
&lt;pre&gt;
#!/bin/perl
use strict;
use warnings;

foreach (&amp;lt;DATA&gt;) {
    chomp();
    my $i = 0;
    my $body = 0;
    my @fixed;
    my @row = split /\t/;
    my $pid = $row[1];
    my $configuration = $row[0];
    my @chunks = split /&quot;;s:/, $configuration;
    foreach my $chunk (@chunks) {
        if (!$i++) {
            push @fixed, $chunk;
            next;
        }
        if ($chunk =~ m/&quot;body/) {
            $body = 1;
            push @fixed, $chunk;
            next;
        }
        if ($body) {
            my ($length, $content) = $chunk =~ m/^(\d+):&quot;(.+)$/;
			for (my $j = 0; $j &lt; 50; $j++) {
            $content =~ s{(/pictures/[^\./]+?)%20}{$1_}g;
			}
            $content =~ s{%20}{+}g;
            $length = length($content);
            $chunk = &quot;$length:\&quot;$content&quot;;
            $body = 0;
        }
        push @fixed, $chunk;
    }
    print &#039;UPDATE panels_pane SET configuration = $ashes$&#039; . 
        join(&#039;&quot;;s:&#039;, @fixed) . &#039;$ashes$&#039; . &quot; WHERE pid = $pid;\n&quot;;
}
__DATA__
&lt;/pre&gt;
&lt;p&gt;Against the trusty database (I ? PostgreSQL!), I ran &lt;tt&gt;COPY (SELECT configuration, pid FROM panels_pane WHERE configuration ~ &#039;%20&#039;) TO &#039;conf_pids.out&#039;;&lt;/tt&gt;, then slapped the Perl code on top and generated a load of UPDATE statements. It&#039;s far from my best Perl code, but it worked and once I gave up on doing things the Drupal way I was able to put it together in a handful of minutes. I now have a functional Drupal 6 instance again, updated such that there are no known security vulnerabilities with either core or the modules we&#039;re using, and there are no broken image links.&lt;/p&gt;
&lt;p&gt;And now I need to begin working towards either grokking Drupal, or finding a content management system that my tiny brain can comprehend, because I don&#039;t want to have to go through these kinds of contortions again with future upgrades... Suggestions welcome!&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 18 Oct 2012 17:48:31 -0400</pubDate>
    <guid isPermaLink="false">http://www.coffeecode.net/archives/261-guid.html</guid>
    <category>coding</category>
<category>perl</category>
<category>postgresql</category>

</item>

</channel>
</rss>