awochna

Blog

Recent Posts

ExpressJS Router Caching Issue?

It’s a fairly common pattern, in my experience, to prepare some routes for your express application in a separate file (module) and export them. Then they can be imported in a file that’s only responsible for putting your server together, with routes and middleware. It’s only one step removed from a solution I’m using in a current project in which I export a function that configures and returns a middleware. Something like this:

Simpletest: Fill out a form and submit it

So I like building my custom modules in the test first fashion. In Drupal, to test de-coupled site functionality from custom modules, it’s conventional (and pretty easy) to use the built-in Simpletest. It provides some pretty neat Drupal-specific functions to help with creating and logging in users, creating nodes, etc. However, some of these functions are a little less than well-documented, but hey, it’s PHP. TDD is a product of my Ruby background because automatic test are valued in that community of developers, as evidenced by the many libraries and some of the test styles even creeping into other language communities, like Cucumber. In PHP, TDD is treated differently and isn’t as important, at least historically. So it only makes sense that the documentation would be a little weak, but anyway.

Red Hat yum update error on filelists

Just a quick heads up for those of you managing Red Hat Enterprise Linux servers out there that might run into the following error:

Tutorial: Ruby command line twitter client

Have you ever wanted to post a tweet from a command line? If you’re like me, you want to use twitter, but keep getting distracted by all the other tweets from the people you follow. (That’s not just me, right?) And, if you’re like me, you would like to use sferik’s command line suite ‘t’ but you’ve already got a utility named t on your command line. (I’m sure that’s also not just me, right?)

Drupal Views Partials: Nested Views

So if you’re working with complex data sets or some sort of workflow system in Drupal, you’ve likely encountered the difficulties in trying to extract that information using views over multiple nodes using a single unique value. For me, recently, it was a site that uses a lot of webforms to collect information from users (with accounts) that need to be viewed by another type of user. These administrative users would want to view who submitted Webform A, with a link to view the submission, but they want to be able to see more information about the user than the standard “/node/[nid]/webform-results” would give them. A view would be perfect; just collect all of the webform results into a table and add a filter for the Content: Title so you only get Webform A. But then, they would like to know if the user also completed Webform 2, because that form is an important part of the workflow and process that Webform A represents. What do you do?