May 2014

Map of BuildAModule Members

Orders come into BuildAModule daily from all over the world, but I wanted to get a sense of just how broad the our user base was. So, I put together a quick interactive map using AMCharts, pulling data directly form our orders database to see just how much of the world has been BuildAModuled. here's what that looks like, with countries having made a purchase in blue:

I created this map to visualize our membership, but I wonder if maybe this map has more to offer. While this just illustrates one company's order activity, it also might be generally representative of where Drupal is most popular and also which countries might have issues making purchases for US-based products. While the two causes might be unrelated, it seems likely that the process of learning Drupal would be hindered if one can't take advantage of books or video training distributed from the US.

So, if you are from any of the countries not highlighted above, let us know what we can do to help get training to your area. Is it an issue with the US dollar exchange rate? Does Drupal not have a solid foothold yet? Is English not widely spoken in your area? Is there generally poor internet access? We'd like to do what we can to help Drupal communities grow, so let us know what you need by responding to this email or filling out our contact form.

And just in case you're curious, here's a map of purchases made in the US, broken down by state (yeah, that's all of them):

You can take a look at these live maps in higher resolution and interactivity on our maps page.

Upcoming FREE day for DrupalCon Sprints!

We're offering BuildAModule for FREE to anyone around the world who wants to help with the DrupalCon sprints, or just wants to beef up your knowledge so you can help with the sprints next time. On June 5th, just go to https://buildamodule.com/free and claim a free 24-hour pass.

Meet me at DrupalCon Austin

In addition to organizing and mentoring at the BuildAModule training at DrupalCon Austin, I (Chris Shattuck) will be wandering around the hallways of the Austin Convention Center, hoping to meet you! Feel free to pull me aside to let me know what you really think about BuildAModule or just say hello. I'll likely be wearing an orange BuildAModule T-shirt and will look something like this:

 

A few squashed bugs on BuildAModule.com

A recent update to the Chrome browser caused the videos on BuildAModule to play erratically. If you ran into this problem, please accept my apologies. But we spent some time working on this and got it fixed! So, if you love Chrome and had to switch to a different browser, feel free to come on back. Along the way we fixed a couple other issues that may have been bugging you (so to speak):

  1. Transcript links now work. So, you can right-click on any part of a transcript, copy the link and visit it later to start playing the video back at exactly that position. This is great for personal bookmarks.
  2. The count above the transcript which should tell you where you are in the collection now shows the right number (sorry about that!).
  3. Images in video updates are now clickable. When we released the big update to our site recently, it broke the ability to view larger versions of the images in the video updates. No longer!

As always, if there's anything you'd like to see added or updated on BuildAModule, please just let us know.

Have a great week!

- Chris Shattuck

This should now be fixed. If you're still having issues with video playback, please refer to our troubleshooting guide.

Recent updates to Chrome are resulting in video playback issues. Please accept our apologies, but in the meantime you should be able to use Firefox, Safari or the latest versions of Internet Explorer to use the site without any issues. We will make an announcement as soon as we've resolved the problem. Thank you for your patience!

BuildAModule is FREE on May 30th for Drupal Global Training Days

Drupal companies and user groups around the world will be hosting free Drupal trainings around the globe on May 30th as part of the Drupal Global Training Days initiative. To support the trainings and also help anyone who can't attend a physical training, we're offering the full 1100+ video library on BuildAModule for FREE on that day.

If you're organizing a training, consider encouraging your students to sign up for a free 24-hour pass to BuildAModule to supplement your curriculum.

If you didn't plan a training, but you'd like to do something to help, think about organizing a Mentored Training for your Drupal user group. It takes very little planning and is a lot of fun.

If you can't attend a training, but want to learn some Drupal, then sign up for a free 24-hour pass on May 30th and work through as much material on BuildAModule as you can. It's not as good as hooking up with live trainers, but it's the next best thing!

A few new videos on using a Dependency Injection Container

This week we dive into using a Dependency Injection Container (DIC), which ultimately serves as a backbone to Drupal 8 and its APIs. First we talk about what a Dependency Injection Container is, and then demonstrate how to create one with Symfony 2.

The disadvantage of instantiating objects inside our framework and how a dependency injection container can help - 3:07

Now that we’ve moved some of our front controller code into our framework, our framework is now creating a number of objects, making it harder to test and less flexible. This is the perfect transition for talking about how a dependency injection container can help manage exactly this type of problem.

(FREE!) How to create and use a dependency injection container, and what a singleton pattern is - 5:29

In this video we create a dependency injection container that allows us to manage a single instance of each one of our classes and allows us to load them only when needed. Along the way we explore what a singleton pattern is.

How to prepare objects in the dependency injection container with parameters and methods - 3:26

Objects in our dependency container sometimes have dependencies of their own. In this video we outline how you pass those dependencies into the container.

Last chance to get 25% off!

There's just a couple more days left to get 25% off your 6 or 12 month membership at BuildAModule. Just checkout with the code DCAUSTIN to get the discount.

Nearly every developer uses this technique to find the code responsible for some output that they want to modify. It's simple:

  1. Find a string in the UI that seems like it would be unlikely to occur elsewhere in the UI. Something like "Settings for the Image Toolkit".
  2. Search the entire project code base for the string using grep or an IDE. If you get few enough matches, you can probably figure out what code is responsible for the output.
  3. Adjust the string slightly and rebuild the UI to see if the change takes effect. If it does, BAM! You know where to get started. (note that you may need to rebuild your application or clear the application's caches to see the change take effect).
  4. You revert the change you just made so you don't forget about it.

Where to find a unique string

Finding a unique string becomes easier the more familiar you are with the application you're working with. At first, you may find yourself searching for strings and getting hundreds or thousands of results. Over time you'll get a sense of the usual suspects and try to find other strings that aren't as common.

While the text in the UI can provide a good source, the "id" and "class" properties of HTML is also a good place to look if you're building a browser-based app. Sometimes these are automatically generated, or the string is added to with prefixes or suffixes, but you can search parts of these properties to see if anything shows up.

If a search doesn't turn anything up

If you search the code base for the string and nothing comes up, here are some tips:

  1. Source is in a database: The string could be being pulled from a database, rather than code. If so, then you can do a database dump and search the database dump file. It will probably be harder to track down exactly how that string came to end up where it is, but it's still a useful clue.
  2. String has quotes: If there are any quotes in the string, then they may be escaped with a backslash, meaning that you're not searching for exactly the right string. To get around this, you can search for one side or the other of the string. For the string "you're in my searches!', you could search for "re in my searches".
  3. String has hidden whitespace: There my be some extra white space that you're not aware of. If you're searching HTML, you can look at the source code to see if there are extra spaces between words, or even extra lines. If you can just grab a single line to search for, you can avoid trying to add the white space to your search (adding white space to search is tricky). Again, you can use the approach of just searching for part of the string.
  4. Searching the wrong case: CSS or your backend code may be adjusting the case of the string, adding capitals or lowercase where it isn't in the source code. So, try searching with the "match case" box unchecked.
  5. String has been altered: The text could be being modified through various process. In particular, unique IDs may be prefixed or suffixed, so try searching for bits between underscores or dashes.

What to do once you've found the source

Typically, finding the source of the string you're looking for is the beginning of your search. The goal is to find the right place to adjust or add to what you see in the UI, and there might be several layers between this entry point and where you'll ultimately add your own code.

  1. Use a debugger: Using a debugger like Xdebug is really useful here, so you can see the full stack of method or function calls leading up this specific point in the code.
  2. Copy and paste: If you're dealing with something modular like a CMS where chunks of code and groups of files follow the same pattern for extending the application, you can probably start copying and pasting entire files or parts of code from various sources and replacing unique identifiers in function and variable names until you get something that can work in parallel with the original code you discovered.

Is there some other name for this approach?

If you know of a name for this technique (one that I didn't make up), please let me know so I can delete this page.

Last week we finished up talking about event dispatching in Symfony - a fun way to add easy-to-use hooks in your code - and this week we're tightening up the framework we've been building by adding error reporting and a controller that can return content directly without a response object wrapper. Next, we'll be talking about how a dependency injection container (DIC) can form an important backbone of objects in your project, so stay tuned!

(FREE!) The difference between setter injection and constructor injection - 1:00

When we instantiate our framework now, we use two different types of dependency injection. We pass two objects in through the constructor, and another through a method in our framework class. We talk briefly about why you would inject dependencies one way or the other here.

How to add custom error reporting to our framework - 3:28

In our earlier framework code, we wrapped the execution of our framework in a try … catch block to figure out how and when to display an error on the page. Our new Framework class gives us the same tool, and in this video we look at how to leverage it.

How to create a subscriber that allows controllers to return strings instead of response objects - 5:45

In order to get more control over our response object, we update our controllers to send strings instead of full response objects. To accomplish this feat, we have to adjust a few places in our code.

Reducing our front controller code by moving it to our Framework class - 3:17

Having a small front controller means that it’s easier to use multiple front controllers in different environments. Now that we have a clean Framework class, let’s explore putting some of our front controller code into it and see if we can’t tighten up our front controller a bit.

Only 3 weeks left to sign up!

That's right, the clock is ticking. If you're coming to Austin and want to get immersed in Drupal in a fun and ultra productive way, come join us at our training.

Read more about the training, or SIGN UP NOW!

This week we're wrapping up our coverage of the Symfony Event Dispatcher - the component that mirrors (and could someday replace) the Drupal hook system. We then look into Symfony's built-in caching and finally trash a huge chunk of our code to instead use Symfony's HTTP Kernel component. It's always fun getting rid of code, especially when you can do the same thing with fewer lines. :)

(FREE!) How a subscriber is different than a listener, and what a 'code smell’ is - 2:09

When you have multiple listeners that will always be bundled together, or that will take the same parameters no matter which application will use them, it makes sense to refactor to us a ‘subscriber’ instead. As we discuss this, we also explain what a ‘code smell’ is.

How to add a subscriber to our event dispatcher - 3:41

Now that we know why we would want to have a subscriber instead of a listener, we go ahead and build one out.

Overview of what we covered around the event dispatcher - 1:47

In this overview, we review the difference between a listener and a subscriber, and briefly outline the steps we went through to set up our event dispatcher. Fun!

How to add caching support to our framework and controllers - 6:29

If you’ve worked with Drupal a bit, you probably understand how caching pages in certain situations can really save on processing power. In this video we explore how to add caching to our Symfony application.

How to use the Http Kernel component to replace our entire framework - 4:34

In this video, we replace all of the custom code in our Framework class with a single class definition using the Http Kernel component. Here it becomes clear that much of what we’ve been doing so far is building up to the point of understanding how the Http Kernel component can be useful.

Add to playlist

Add to , or

Add to new playlist:

Add to playlist
This is a member-only feature
But, it's easy to become a member

Add to cart:


Loading...
Contact us

Below are the supported keyboard shortcuts for our video player.

space
Start / stop video
shift
Go to next video
shift
Go to previous video
Increase or decrease player speed by 20%
Skip ahead or go back by 15 seconds
1...9
Jump to a percentage (2 is 20%, for example)
f
Toggle full screen
Videos Pricing More Search
BuildAModule Logo Icon BuildAModule Logo Icon
Become a member!
$29
1 month
$156
6 months
10% off
$276
12 months
20% off
All memberships come with the following:
24 / 7 access to the entire 1800+ video library
An innovative video player with a rolling transcript
Extensive Drupal and cross-platform training
A thorough and thoughtful training style
Progress tracking
Take notes on specific video sections
Intuitive multi-user management
How many users?
user
Go solo with a single user, or give multiple team members access through one account and get discounts by bundling multiple users into a single membership.