More Gutenberg madness (“This block has encountered an error and cannot be previewed”)

The WordPress Gutenberg project (a.k.a. the Block Editor) is supposed to make building WordPress sites faster and… well… once you get the hang of it, that often is the case. Recently I’ve actually marveled at how quickly it has allowed me to build out a site, now that my base theme is getting a bit more polished. And creating block patterns in WordPress 6 is super slick, after you learn a few of its quirks.

But then, the Block Editor will throw me a curveball that can derail things for days. For instance, there’s this:

I have a site using my custom theme that all of a sudden started throwing out this message after a recent update. It’s on the Separator block (a.k.a. a glorified <hr> tag). I took a look at the code, and there’s nothing overly complicated going on. The best clue I had to the problem was that it may have something to do with the .has-alpha-channel-opacity CSS class getting applied to the tag.

Then I noticed that in a child theme I’m building for another site, the error didn’t occur. I tried switching between the child theme and parent theme, and sure enough — with the parent theme, I get the error; with the child theme, I don’t. So… what is it?

Well… with almost any type of problem solving, it’s about trial and error, finding differences, ruling things out, and narrowing your search. But it was really hard to find anything between the parent theme and child theme that might cause this. Certainly there were no differences in how they treat Separator blocks.

I came back to that CSS class. Why is that there? Where Gutenberg is concerned, when in doubt, it’s always a good idea to have a look at the theme.json file. And, sure enough, that’s where the difference was. In my parent theme, I had this (note line 13):


But in the child theme, I had this:


Yes, for some reason, an empty array for the color.gradients setting allows the Block Editor to properly parse the Separator block, but a null value causes the error.

WHY???

I don’t know. I don’t really care. At least I was able to fix it. But this again makes me question the wisdom of the entire Gutenberg enterprise. I still don’t really buy the rationale that this JSON file is the way to go, although I am at least starting to understand why it was chosen. However I think this example illustrates some of the negatives of the approach.

Solid Gold Countdown ’82

Last week my wife tipped me off to this amazing artifact on YouTube, the broadcast by Pittsburgh’s channel 11 of the special Solid Gold Countdown ’82, which is… just… well… I can’t even put it into words. We watched the whole thing.

There is so much to unpack here. If you didn’t live through 1982, this will feel like it’s from another planet. As for me, it feels like going home.

But, I just have to say… of everything in here, the little nugget that has stayed with me for days after watching it is the commercial for a local car dealership, offering the low low interest rate of…

11.9%

Ubuntu hits the big time, for real this time

Ubuntu LinuxI just finished installing Ubuntu Linux 9.04 on my MacBook under Parallels Desktop. In the past, I’ve ventured boldly into the realm of triple-boot configurations to allow my Mac to run Mac OS X, Windows XP and Ubuntu Linux. But that involves modifying firmware and overriding the standard boot process, plus splitting your drive into 3 partitions and reciting dark incantations by the light of the full moon whilst drinking the blood of a calf slain with a silver blade.

Well OK, not that last bit. I’m not sure where that comes from (oh right, that was the part about installing Windows on the Mac). But suffice to say, while it certainly could be done, setting up triple-boot was not for the faint of heart, and once it was working, the question of whether it was all worth it loomed large. And no, I cannot think in non-clichés tonight.

When I got my new MacBook a couple months ago, I decided my days of triple boot were over. I was just going to go by the book (see what I mean?) and use Boot Camp. Well, sort of by the book. Never one to take the easy road, I wasn’t just using Boot Camp, but also running Parallels Desktop. And while you certainly can run a valid Boot Camp installation of Windows XP with an OEM license (the cheapest way to go, courtesy of Newegg.com) both directly via Boot Camp and also with Parallels, Microsoft doesn’t make it easy for you. It involves calling an automated Microsoft support line, and reciting dark incantations by the light of the full moon — I mean reciting a 48-digit number displayed on your screen, answering four simple questions asserting that you have only installed Windows on one computer and you would never, ever, ever, ever lie to Microsoft or Steve Ballmer will bite the head off a live goat and put it in your bed while you sleep, and then typing in a new 48-digit number the automated system recites back to you, while it slays a calf with a silver blade, yadda yadda.

Now where was I?

Oh yeah, Ubuntu. A new version of Ubuntu Linux is released every six months, the latest version, 9.04 (so named for being released in April 2009, get it?), having arrived on the world’s virtual doorstep earlier this week. Ubuntu releases all have clever, alliterative codenames too. This one is Jaunty Jackalope. I’ve been following Ubuntu (via the triple-boot ritual) since Gutsy Gibbon (7.10), through last year’s releases of Hardy Heron (8.04) and Intrepid Ibex (8.10), the latter of which powers this website, thanks to Slicehost.

I’ve been more and more impressed with each release of Ubuntu, as the Ubuntu development team has polished the user experience — especially the once-nightmarish installation process — and as the GNOME team has simultaneously polished the desktop software most Ubuntu users live in day-to-day. While I’m still a die-hard Mac lover, I’ll admit Microsoft has been making major improvements with its GUI design (despite other notorious issues) with Vista, and Ubuntu/GNOME has been getting better and better with each new release as well. But I really feel like 9.04, Jaunty Jackalope, has finally crossed the line where Ubuntu Linux now feels to me every bit as polished, professional, usable and pleasing as a commercial OS. The installation process is far easier, and faster, than a Windows installation, and the overall experience of the interface is clean, intuitive, and responsive.

So it occurs to me, even in this age of netbooks and Microsoft’s (and to a much lesser extent, Apple’s, at least where the Mac is concerned — iPhone is definitely their top focus these days) recent floundering, while Linux, Ubuntu in particular, is making inroads, it’s still just not going to be embraced wholeheartedly as a viable desktop alternative.

Why is that? Well, obviously Microsoft doesn’t want that to happen. Linux really much more of a threat to Microsoft than it is to Apple. Even though all three OSes can run on Macs, people as a rule just aren’t buying Macs to not run Mac OS X. I’m sure it happens but… really… why? So the major hit to commercial OS developers comes when a user buys a non-Apple computer and decides to install and use Linux (Ubuntu or otherwise) as their primary/sole OS instead of Windows. So even as Linux, and the world of free, high-quality software that comes with it, reaches maturity, and Microsoft gives us an OS that is best known as the butt of jokes (not to mention viruses and malware of all sorts), why aren’t more people switching?

Ultimately there must be some software that users are relying on for Windows that they just can’t get for Linux. It’s the same argument often leveled against Macs: “not enough software.” It’s a straw man argument. Sure there is vastly more software written for Windows than for the other OSes, but 99.9% of that Windows-only software is: a) highly specialized tools for specific industries, b) utter crap, or usually c) both. Especially when we’re talking about consumer software, whatever it is you want to do can be done just as easily on Windows, Mac or Linux. The software exists. Often between Macs and Windows it’s the same software, ported from one OS to the other or developed concurrently. With Linux it’s usually open source alternatives that are every bit as feature-rich as their commercial counterparts.

Linux has decent free options for managing photos, listening to MP3s, editing video, and all of the office tasks covered by iLife and iWork on the Mac, or by Microsoft Office and the parade of unimaginatively named Microsoft tools or OEM add-on crapware that generally comes preinstalled on Windows PCs.

Except one.

No disrespect to the developers of GIMP, but the one software program Linux absolutely needs in order to be taken seriously as a desktop OS is Photoshop. That’s it. Once Adobe stops wasting its time writing terrible custom installers and decides instead to devote those resources to porting Creative Suite to Linux, it will be all over. Windows will never go away, I’m sure, but it will be reduced to a niche OS: it will live on mainly to support legacy point-of-sale systems and industrial fabrication applications and the other arcane and ugly commercial applications that companies generally deployed in huge numbers back in the Windows NT 3.51 era and have left untouched for more than a decade.

Adobe, it’s all up to you. You owe the world a karmic debt after Bridge.