Blob of contradictions


But I just want one field! Using field_attach_load()

Fri, 04/13/2012 - 12:00 -- btmash

Yesterday evening, I was working with a client on their site who are doing some interesting things with one of their custom search pages. They send ajax requests to the backend to get 2 types of values for their user:

  • A count on the total number of a node type X that matched the criteria
  • A count on the total number of another node type Y that is referenced in node type X (Y can be referenced multiple times by various X but for this, we just want to get back that value.

Instead of opting to go with straight database queries to get the data, they were using the EntityFieldQuery manner to get the initial list of X since they were using fields. Its not quite as fast, but its a much more flexible approach (and if they opt to change their field storage in the future to something like MongoDB, they can have something really fast without having to change a single line of code!). The one problem with EntityFieldQuery, however, is that it will only return back a listing of entity IDs. Meaning that if we want to get other pieces of data, we have to load up the entity. In their scenario, the only other piece of data that they wanted to retrieve was the reference field data. And performing an entire entity_load (or node_load to be specific) would mean they would also need to load up the 50 other fields that they are storing. So doing a retrieval like this on uncached content meant that the retrieval of this data alone took 3 to 4 seconds.

JQuery UI Datepicker: highlighting dates with events

Sat, 10/22/2011 - 00:32 -- btmash
A picture of the jquery ui datepicker highlighting days with events.

Since the last time I posted on using the JQuery UI Datepicker for event navigation, we launched the site that I built out this functionality for (if you are interested, visit REDCAT). A few months ago, we received a feature request to extend the set of functionality by displaying (or highlighting) the list of events that occur in a given month.

Drupal Camp LA 2011 - recap of an amazing time.

Mon, 08/08/2011 - 09:52 -- btmash

Over this past weekend (August 6 and 7, 2011), the LA Drupal User Group held its annual Drupal Camp. There were 55 sessions planned over the 2 days by various members of the LA Drupal community (with a few by those visiting LA just for this camp ^_^). I don't know what to say that hasn't been said by more eloquent bloggers but it was a whole lot of fun :D

Subscribe to RSS - fun