Made of Everything You're Not

Guess I Better Start Contributing (... again…)

Let's play a game. Let's suppose nobody knows who you are or that you're a programmer and you need money. You have MASSIVE debt and it's draining your resources, just to tread water, every month in interest alone. You're also not so much a "people person", as you are suspicious and leery of humanity as your default. Let's also suppose you live on the edge of downtown Tucson Arizona, a town not exactly notorious for its silicon alley, so remote work is your only real option. So, how do you start making money?

Yeah, I don't know either. So, while I figure that out, I've started focusing on working within the ExpressionEngine community on various initiatives in my downtime. I had spent almost 5 years prior to my little startup adventure working with ExpressionEngine pretty heavily, so there's a certain amount of logic to revisiting the platform. Familiarity, community, and whatnot.

Working a lot in fact. Mostly in obscurity it turns out 'cause sometimes you have to toot your own horn and I wasn't tootin'. So, as I've just started writing again, I thought it'd be fun to put a spotlight on a few tasks I've been working on. And by a few I mean here's a comprehensive list of things worth mentioning. *Toot Toot!

EE Unit Tests

If you had asked me back in 2017 what I would like to see added to ExpressionEngine, it would have been the ability to run unit tests easily. If you're not familiar, previously, ExpressionEngine had been built in such a way as to require an entire bootstrap layer and the inclusion of a global object layer, within your tests. Your tests needed database access, and the use of the entire ExpressionEngine codebase needed to be available through the global ee() super function. So getting up and running for tests pretty much sucked. Real pain in the ass to get setup and running.

But with ExpressionEngine 6.1 (and back in November of 2021) that now became a trivial exercise. I mean, you still have to deal with the inclusion of super global objects but now you can easily run PHP Unit without the bootstrap layer So I put together a damn simple Add-on to make it even simpler. Take a look at EE Unit Tests on GitHub.

Datalist FieldType

Around the time I was pecking at putting EE Unit Tests together, I was trawling the ExpressionEngine Issues list on GitHub. One specific Issue stuck out to me; someone wanted a datalist FieldType to be included with ExpressionEngine.

See, one of the things I started doing during my search was to dig through the list oldest to newest. I had this idea to do the most outstanding Issues and help whittle down the list. And I found a good one. Just, not a good change to the ExpressionEngine core. This, was a custom FieldType.

Why? Because there exists a third party FieldType API it makes zero sense to saddle Packet Tide (the owners of ExpressionEngine) with the burden to maintain the addition. Community wants it, the community can maintain it; I'll start.

And, to be honest, it kind of scratched a couple itches of mine. I wanted to help (for real though!), but I also really needed to get up to speed on the FieldType API. And in December 2021 I released DataList FieldType.

EE Objects

This is a MUCH larger topic for later, but after working with ExpressionEngine for a few months I started to notice some opportunities for improvement. After being gone for so long, and working with other technologies, some of the paradigms built into ExpressionEngine still required a lot of the same boilerplate from the CodeIgniter days. Kinda bummed me out to be honest.

So I rolled up my sleeves and got to work. Enter EE Objects; a collection of objects to work with ExpressionEngine programmatically. Right now, it's still very much unstable and in a proof of concept state, but the idea is to make things easier for everyone when developing for ExpressionEngine.

I'll be writing about this in detail coming up, and also speaking about it at the Spring EEConf so won't go into detail here. Still, check it out if you're curious.

Pull Requests

In addition to the above stand-alone projects, I've also tried to take an active hand in whittling down the crazy Issue list on GitHub. Not gonna lie, it's a lot more effort than I thought it'd be. I really wish I could do more of these but just haven't had much time for this lately. Will definitely be picking it back up when able though!

Icon Dates

While I was trawling the Issue list I reached out to a buddy and asked them straight out, "which you think I should do?", and they came back with this one: Provide a method to quickly distinguish published entries from scheduled entries. Which, with a title like that, my hands were tied; I was in.

But, as I'm UI challenged, this was/is trickier than I thought. While I could implement the business logic without much issue (and I started the Pull Request on December 2021), making it look "good" and "not bad" has proven troublesome. So, if anyone wants to take a stab, the Pull Request can be found on GitHub.

CLI Time Limits

In a prime example of "you found it, you fix it", I found a bug within ExpressionEngine while working on a client project. Nothing big, the coding equivalent of a typo, but I found a bug so I fixed the bug.

This was included in ExpressionEngine 6.2.2 on January 17th 2022.

Issues with Avatars

Continuing on with my strategy of hitting the oldest GitHub Issues first, I found another good one with the Problems with avatars Issue. This Pull Request was a little more involved than the previous bug fixes since the reported Issue ended up being just the tip of the iceberg.

In a nutshell, the entire Avatar layer was problematic. The root problem the Issue mentioning were true but there were quite a few problems on top. We're talking bad meta handling, flawed upload logic, thumbnail generation was just odd; a whole refactor was called for. Pretty fun and easy task though.

This was released on February 10th 2022 in ExpressionEngine 6.2.5

Command Name Length

This was another example of finding an issue and fixing the issue. Basically, when you used the new list command through the CLI system, it would truncate the names and details provided. Basically, render a tool that should provide details into a tool that didn't in certain cases.

Was a pretty fun exercise though. ExpressionEngine has a really clever CLI layer, and how they rendered the interface taught me a lot about the sprintf PHP function. Seriously. It's a lot deeper than I initially had thought.

This was released on February 23rd 2022 in ExpressionEngine 6.2.6

Eric Lamb

Builds things. Has thoughts. Sometimes they're even worth sharing.

Elsewhere

  1. GitHub
  2. Twitter