07 September 2012

Drupal 8 Multilingual Initiative Code Sprint weekend

I took a train from Frankfurt (Germany) down to Munich the Saturday before the DrupalCon. When I joined the Multilingual Sprint on Sunday morning, many of them had already been sprinting for a full day and a number of issues were ready for review, so I dived in, observing the behavior of Drupal 8 before and after applying patches, proof-reading the patches for anything odd (e.g. typos in the documentation), discussing the issues in comments and in IRC with people who were sitting just across the room (other times actually speaking in person). By the end of the day, instead of the dozen or so people that Gábor Hojtsy, the Multilingual Initiative team lead, had expected, there were close to 50 people at the location, some joining us in the work on Multilingual issues, some working on other Drupal 8 tasks, and some who were just arriving in Munich and followed the Tweets to where we were. Luckily, the location rented for the Saturdays and Sundays before and after the DrupalCon week was big enough to accommodate all the extra arrivals.

While on the topic of the venue we used for those weekends, I’d like to personally thank Stephan Luckow and Florian (“Floh”) Klare of the Drupal-Initiative e.V. for all that they did to find a nice place that would still leave us with a budget for food and for their valiant work on stretching the food budget while still serving up excellent fare, in keeping with the fantastic meals we enjoyed the rest of the week. Instead of ordering delivery, they prepared almost everything themselves, including beautiful open-face sandwiches, fruit platters, and lovely grilled specialties at a club we went to where you can barbecue in the Biergarten.

…thanks for the huge help to the local organizers, especially Florian Klare and Stephan Luckow. They helped us manage collecting and spending sponsor money wisely with the Drupal Initiative e.V, prepared great sandwiches and fruit plates for us and even organized a sprinter party night with grill food. It was amazing to work with such helpful and flexible local organizers.
Gábor Hojtsy, September 5, 2012

Luckow and SirFiChi of the Drupal Initiative, organized the location and made us great food!

Since people were “fresh”, I think a lot of work got done on the first weekend and the Monday before the conference (more than 50 people joined us and worked on various core initiatives on Monday in the room we later used for core most conversations at the Sheraton), which also meant that issues were still fresh in our minds while we had days of sessions and conversations, so when we started sprinting again on Friday we had lots of new ideas for the tasks we were still working on. Friday’s sprints were at the Westin Grand, where there was great attendance both upstairs in the main room as well as a large room downstairs from it, where Drupalize.me hosted a core contribution workshop to ease people into the process of contributing to core. I decided to go to that workshop since I’m still pretty new to it all and found a few people sitting nearby who were I was also able to interest in some Multilingual tasks, so while the main group sprinted upstairs, we also worked downstairs. Later on, I came upstairs, and since there were not a lot of simpler tasks for “core newbies”, like myself, I took some time to sprint on a module I contributed some time back, before there was much of anything for Drupal 7 in the area of “multilingual”… and tried to make my module more multilingual-friendly. I got a few good commits and a new release out for Internal Links and also recruited a colleague to look at the code with me, provide some ideas, and become another maintainer. So I personally found Friday quite productive.

07 September 2012

I started writing this post at the DrupalCon and then continued work on it on the train back home after a long week, last Sunday after the code sprints—even now, more than a week later (after being ill for a week—I think I was burning the candle at both ends for a bit too long), it’s hard to believe that it’s finally over. I arrived the weekend before to participate in the pre-con code sprints and stayed for the Friday–Sunday after the conference to continue that effort. I’ll write about the sprints in another post. This one will cover the highlights of the actual DrupalCon, what I think worked well, and recommendations for those attending their first DrupalCon; with two new continents getting a ’con this year, I think there will be more than a few at their first.

The food at DrupalCon Munich was great

For me, one of the major highlights of this conference was the outstanding food quality. It was so good I was distracted enough I never pulled out my camera to take photos of i, but it was attractive, gourmet, and delicious and there was something for everyone, even a fantastic salad buffet as well as more desserts than anyone could try… and hot dishes with plenty of options for both vegetarians and omnivores, alike. In the closing plenary, it was revealed that the catering costs for the event were about €352,000 for the 1800+ of us in attendance; not surprising for the quality and abundant variety of fare they served us. Food service tables were put in place in all areas of the conference so that there was no crowding into one area and the same dishes were provided at both the Sheraton and the Westin Grand, which were a few minutes’ walk away from each other. The conference occupied the three conference center floors of the Westin Grand and a few smaller rooms in the Sheraton, which were primarily “core conversations”. One might think I would gorge myself, but most days I had simple salad items, walnuts, and seeds… and gave myself a break before finishing with some fresh fruit and a light mousse from the dessert buffet. Despite the fact that the days were hot and many of the rooms weren’t well conditioned, people were alert and in good spirits and I think the food had more than a bit to do with that.

To continue a moment in the vein of “food”, since I really do think it was notable at this DrupalCon, I hope this reflects some new recognition of the importance of good sustenance when organizing a successful event like this. And I hope that future Drupal events will also place emphasis on food quality. That said, I also think that the community would pull together if we had commercial kitchen space and quality ingredients—we could prepare similar gourmet meals without quite the budget we used for catering at this conference; on the other hand, such a model might work better at one of the large DrupalCamps (a few hundred attendees) than at a huge (North American or European) DrupalCon. Of course preparing our own food would provide another place for people to connect (food preparation and more volunteer service), which I think would offset the downsides (not being able to be someplace else whenever you have “kitchen duty”).

The Venue

munich_olympic-park.jpg

Munich is a beautiful city I’d never really visited before the DrupalCon. Public transportation was not too expensive, but I got to see a bit more of Munich by walking almost everywhere, so my walks back from the pre-conference sprints and out to dinner (beer) in the evening were mostly through parks where I got to see the huge Olympics installation and unusual sights like Munich’s famous river surfing.

Surfers have a man-made wave on the Eichbach

Sessions and participation

Choosing sessions

This was my second time attending a DrupalCon and I decided I wanted to primarily attend the “core conversations” track (with a few exceptions). For those who don’t know, the “core conversations” sessions are where plans for the future of Drupal are presented, discussed, and refined. It’s truly an amazing experience to sit in a room with dozens of top-notch developers as they hash out the architecture for new Drupal features or present the innovations they have already completed. Of course participating in the Drupal 8 (Multilingual initiative) sprints in Barcelona (a couple months ago) and before and after the DrupalCon session days probably also spurred my interest in the areas being covered by other initiatives, but it is definitely an interesting track if you are not sure what to attend. In the past, core conversations were often not fully recorded, another reason I chose to attend this track, but it looks like you can view most core conversations pretty well now, online. If you missed them and are interested in the future of Drupal (i.e. Drupal 8), there are many that you might want to watch.

Volunteering

Another first for me was helping the DrupalCon staff as a volunteer, mostly monitoring the rooms I was in and taking a head-count in mid-session. Other activities of a room monitor included being a bit early and making sure the speakers had everything they needed; I got to loan out a display adapter for one session and was prepared with multiple power adapters if anyone happened to be missing a way to plug in—we also tried to make sure that questions were recorded in session audio (either by having those with questions come to a microphone or the speaker repeating the question). I found volunteering rewarding and I thank Adam Hill, the DrupalCon Munich volunteer coordinator, for being a great guy to work with.

DrupalCon Munich Volunteers

Drupal 8 will be great!

Angie Byron’s current overview of Drupal 8 (aka “Drupal 8: What you need to know”) had not changed a lot since I last saw her similar presentation at the “Developer Days” in Barcelona a couple of months earlier, but it filled the largest session room, so there may have been close to 1,000 in attendance. Some features are more polished, some of the features are not yet written, but are better conceptualized than they were a couple of months ago, but the general ideas are mostly the same so in a presentation providing an overview of Drupal 8, while much has changed, it wasn’t much that affected the presentation. I’ve take the liberty to add a few specifics which were actually covered in separate sessions (sessions which covered each core initiative, for example), just for the sake of brevity and consolidation of information.

Webchick presents an overview of Drupal 8 features and initiatives

One key point that was made by all Drupal 8 core initiative leads is that we are only 3 months away from “Feature freeze” for Drupal 8 (December 1st, 2012), so it’s time to pitch in and try to help get all the great planned features into Drupal 8. All of the major initiatives need help and have areas where they are behind schedule as far as being ready for the freeze deadline with all the features the community would like to have in core.

Key Drupal 8 initiatives and components

09 August 2012
Modules of the month story banner illustration.

July saw a bumper crop of interesting new modules contributed, many of them with already-stable Drupal 7 releases. The kind of modules being released now also seems to be indicative of Drupal 7’s level of maturity. We are no longer seeing the modules which fill gaping holes in the standard feature-set, but now we are seeing loads of performance-enhancements, accessibility improvements, productivity tools for Drupal developers, backports of Drupal 8 awesomeness, mobile theming augmentation, and integrations with non-PHP-based systems, just to name a few of the common categories that seem to be trending at this point in the release cycle. And the mainstay modules that have had some major issues have almost entirely been released in stable versions (but they are not within the remit of this article). Yes, things are looking good.

Indeed, there are so many interesting new modules this month, that it’s harder than ever to choose which ones are worthy of profiling here, so the list is quite a bit longer than normal. I hope you are as excited as I am to see all the cool stuff that’s now easier-than-ever to do with your Drupal-based site.

As usual, this list does not include most “integration modules” for fee-based commercial services and likewise leaves out modules which, at time of review, did not have an official release of any kind. Modules for very “niche” audiences (such as those for integration of regional services) are also omitted, among others which seemed a bit too complicated to provide a short explanation of what they bring to the table. It’s possible some of these more complex modules might be covered in separate articles, though.

Enough with the caveats and chit-chat… let’s look at the modules!

06 August 2012
New spam content posted

Rules is an especially useful Drupal module for all kinds of tasks. One use you might want to put it to is providing admin notifications of certain events on your site, e.g. user registrations (covered in the previous post) and the creation of new comments and content by “untrusted” users (assuming your use case allows them to create any content at all). For some use cases, you may wish to put strict limits on the creation of user accounts and content, but for the purposes of this article we are assuming you are administering a Drupal site where you want to encourage growth and community involvement, so you might allow anonymous users to comment on posts (albeit likely with the rel="nofollow"* attribute added to their links). And you might also allow users to create and confirm their own accounts and then create some types of content (e.g. forum posts, bug reports, etc). The downside is that you’ll need to be vigilant about squashing all the spam this policy invites (or the flow of new spam will quickly increase and be damaging to your SEO efforts), but on a site with only moderate traffic you should be able to manage this without a lot of trouble. This post covers using Rules to provide notifications of new comments and content. If you keep a close eye on user registrations and immediately block the user accounts which follow a pattern like other spam accounts you’ve removed (i.e. accounts likely created with the help of a “spambot”), you can eliminate almost all of the spam that requires use of an authenticated user account.

Adding rel equals nofollow to Drupal Links

*Adding rel="nofollow" to links posted in “Filtered HTML”, presumably the only text format you allow for “untrusted” users, is simple, but well worth doing if you allow “anonymous” or newly-registered “authenticated” users to make any kinds of posts on your site. In Drupal 6, go to admin/settings/filters/1/configure and select the “Spam link deterrent” checkbox. In Drupal 7, go to admin/config/content/formats/filtered_html and find the vertical tab near the bottom labeled “Limit allowed HTML tags”, where the same feature is enabled with a checkbox labeled “Add rel="nofollow" to all links”.

Getting back on topic, the three events we want to create Rules for are:

  1. New user registered (done, see previous article)
  2. New comment posted by “untrusted” user (described below)
  3. New content posted by “untrusted” user (also described below)
In each case, we simply want to send an HTML email* to notify at least one member of staff (anyone with the admin role and, in the case of comments on blog posts, we might want to also email the article’s author.) As with the past installment in this two-part series, this article does not cover configuring your server for sending mail nor setting up HTML mail, but we use Mime Mail for the “send HTML mail” versions of the exported code you’ll find attached. (See attachments to this article for code you can use to import these Rules into your own system—you’ll possibly need to tweak them a bit, but they could save you some time.) Where screenshots are included, we’ll display the Rules administration interface in both Drupal 6 and Drupal 7, side-by-side, since there are some differences that might otherwise lead to confusion. So this article should be helpful for administrators of both Drupal 6 and Drupal 7 sites.

In every case, creating a new rule starts by going to the “add rule” page:
D6: admin/rules/trigger/add
D7: admin/config/workflow/rules/reaction/add

Notify Admin (and/or content authors) when new comments are posted

This rule sends an (HTML or plain text) email which includes the comment title and body, along with a link to quickly edit it. Here at Cocomore, rather than delete comment spam, we’ve been unpublishing the comments so we can still observe patterns. So we don’t get an email for each of our own responses to comments, we configure the rule to only notify us when “untrusted” users (i.e. any users who don’t have a “staff” or admin role) post comments.

11 July 2012
Modules of the month story banner illustration.

In June 2012, there were over 160 new Drupal modules released. This article provides some coverage for the most noteworthy of those modules, at least from our point of view. As in the past editions of this article, we generally ignore modules which are only for limited use cases or which simply provide integration of commercial third-party services. We also have not tried out many of these modules and have not thoroughly tested any of them. We normally don’t list modules that seem to be far from “ready” (e.g. no actual release yet), but we can make no claims as to the stability of the modules covered. Be sure to back up your database before testing new modules that might cause pain and suffering.

I think that many might agree that some of the most significant new modules from June were Author, Edit, and Layout—released by Angie Byron and Wim Leers as part of the Acquia-sponsored Spark distribution, which aims to improve the content-authoring user experience for Drupal 8 (the current distribution and modules allows us to use these improvements in Drupal 7 and help improve them). This work is still not ready for use on production sites (“dev” releases at most), but the progress is exciting, nonetheless. And despite the fact that Acquia is sponsoring development, we can all contribute to this awesome project by experimenting and reporting our experience (bug reports or ideas about ways to further improve the user experience) and/or submitting patches. We are definitely excited about Spark!

Thanks to Sascha Grossenbacher and Miro Dietiker of MD Systems there are a number of new support plugins for the Translation Management Tools (TMGMT) which they have recently released, now providing support for translation services available from Google, Microsoft, MyGengo, Nativy, and Supertext. Each of these new modules that extend the main Translation management module are currently available as dev releases for Drupal 7.

Matt Cheney of Pantheon Systems has also recently released a number of exciting “apps” (modules which depend on the Apps module) to flesh out the feature-set of their popular Panopoly distribution; these include: Panopoly Admin , Panopoly Core , Panopoly Demo , Panopoly Images , Panopoly Magic , Panopoly Pages , Panopoly Search , Panopoly Theme , Panopoly Users , Panopoly Widgets , and Panopoly WYSIWYG. All of these new modules are still considered to be in “beta” for Drupal 7, and while some of these may work without the Panopoly distribution, I won’t cover their functionality in detail. They do appear to provide some useful enhancements to Drupal’s standard installation and what their distribution could formerly offer, so this is some significant progress and worth taking a look at if you want to provide a friendly user experience or want to keep up with the latest and greatest in development for distributions.

The rest of the most noteworthy modules are listed in alphabetical order with brief descriptions of their functionality, development status, and module categories on Drupal.org (in some cases, we selected appropriate categories if none were provided on the project page. A couple are not actual modules, but are included as Drupal “projects” also worthy of mention.)

05 July 2012
New Spammer Registered

Rules is an especially useful Drupal module for all kinds of tasks. One use you might want to put it to is providing admin notifications of certain events on your site, e.g. user registrations and the creation of new comments and content by these “untrusted” users (assuming your use case allows them to create any content at all). I recently created such rules to help monitor the creation of users, content, and comments on drupal.cocomore.com/.de. Since we use the Project module (and supporting code) to host and track issues on some Drupal modules, we allow users to create accounts and “Issue” nodes. But there hasn’t been much recent change to the modules we host, so most of the “users” turn out to be spamming scumbags who post “issues” with links to questionable sites (you know the type). Since we allow anonymous users to comment on our blog posts, we also get our fair share of comment spam, but a tricky Captcha (we’re using Riddler, these days, to filter out visitors who don’t know or can’t take the time to search the answers to simple Drupal trivia questions) helps keep comment spam to a minimum. Keeping vigilant about stomping out spam is important since leaving spam published looks unprofessional and is bad for SEO… and since it also attracts more spam (spammers see that your site leaves spammy links in place); but of course it’s also important to keep an eye on the valid posts, too, and to respond to them in a timely fashion.

So we will assume that you have a site without a massive flow of new user registrations or new content and that you want to be alerted with some useful information whenever these events occur so that you can take appropriate action (block users and clean out the spam… or respond to valid content/comments). This article will lead you, step-by-step, through the creation of three different rules on both Drupal 6 and Drupal 7 -based sites, identifying particular set-up differences between these versions of Drupal/Rules. The three events we want to create Rules for are:

  1. New user registered
  2. New comment posted (by non-staff user or “untrusted” user)
  3. New content posted (again, by some kind of “untrusted” user)
In each case, we simply want to send an HTML email* to notify at least one member of staff (anyone with the admin role and, in the case of comments on blog posts, we want to also email the article’s author.) This article does not get into the various particulars of configuring your server to be able to send mail; there are a number of factors which might differ from server to server and it’s not really within the scope of a Drupal-related article.
*Note: This article also does not cover setting up HTML mail, but some modules, such as Mime Mail help make this a relatively pain-free process and provide a “send HTML mail” action for Rules. Adding specialized modules is probably not justifiable if you don’t plan to use HTML mail for anything more than admin notifications, but if you want to email users, such modules can help you create much more attractive and useful emails.

In every case, creating a new rule starts by going to the “add rule” page:
D6: admin/rules/trigger/add
D7: admin/config/workflow/rules/reaction/add

Notify admin when a new user registers

This is a simple rule which sends an HTML email with a link to a new user’s profile, along with their username. If you allow users to register themselves on your site, you will likely notice patterns that persistent spammers follow and be alert enough to just block the most suspicious user accounts before they even start spamming your site. I won’t specify the suspicious patterns I’ve been reacting to here (I don’t want to teach spammers how to be sneakier or more effective), but if you have a spam problem, you probably already know the patterns or will quickly recognize them.

19 June 2012

It’s been a busy past several days in Barcelona (for the Drupal Developer Days) and most of us who’d been sprinting during the week before seemed to be in the same condition by Sunday—rapidly running out of energy from progressive sleep deprivation from an increasingly later return to our hotels. But it’s been an exciting week for Drupal core (and contrib) development and significant work has been completed on the Drupal core (mostly building up Drupal 8, but also some for added features in Drupal 7) while a lot of important decisions have been made which will likely shape development in a number of initiatives for the coming months until the sprints at DrupalCon Munich.

In addition to the Sprint I was primarily involved in (I was just trying to get my feet wet with assisting the Drupal 8 core development process by joining the multilingual sprint, but I did write my first committed core patch—admittedly this was a very basic patch), there were also sprints running for “Views in core”, Entity API, Media initiative, Mapping in Drupal 7, configuration management, abstracting social networking, search-related sprints, the Drupal.org upgrade… and possibly more still. I’ll cover some of the highlights of the week that I’m most knowledgeable about.

Multilingual Initiative

The multilingual initiative sprinted all week before the Developer Days sessions, and even continued through the weekend. And a lot of key decisions were made and important code changes committed and pushed to the central Drupal 8.x repository.

New user interface translation improvements in Drupal 8

This is something I got to do a bit with, but Swiss developer, Michael Schmid (Schnitzel on d.o), of Amazee Labs, was the primary developer working on this task during the Sprint. He and his colleague, Vasi Chindris, were among the stars of the week. It was a real privilege to get to look over their shoulders and to get Michael’s support when it came to using Git to manage code in the sandbox we were using for the issue. (Thank you, once again, Michael!) Once everyone was happy with the work, it got committed to core. This new sandbox workflow, used for larger issues, helps avoid a lot of bugs creeping into the main branch, as has happened during previous periods of intense core development. Of course the tests and test bots catch a lot of issues which could otherwise be major headaches for all concerned (automated testing was also a part of Drupal 7 development). If you recall, the long wait for Drupal 7’s release was due to hundreds of critical bugs. Now this should be a thing of the past since we have an established threshold for critical issues; and the core team only commit new patches to the central repository when we are below that threshold (15 “critical” bugs, 100 “major” bugs… among other thresholds specified).

New system for translating Drupal’s user interface

The new user interface translation system allows you to keep imported (community contributed) translations separate from customized translations and search for a particular translation within either or both categories as well as filter by translated strings, untranslated strings, or both. If you have any unsaved translations, they are highlighted to help remind you not to leave the page without saving them and there discussion about providing a dialogue to prevent a site admin from accidentally leaving the page with unsaved changes, too. There is also an issue to allow the string search to be non-case-sensitive (checkbox) to find more strings that contain a particular word or phrase, regardless of text case. Since this feature came up in discussion after the rest of the user-interface changes had already been made, we elected to put the discussion about adding this feature in a separate issue. If you have ideas for what might further improve the Drupal 8 user-interface translation workflow, your input is valued.Customized and imported (community) translations are stored separately

14 June 2012
Morning stand-up meeting at the Drupal 8 Multilingual Sprint

I was supposed to get into Barcelona at 10:30PM on Tuesday evening, but with delays in my flight, it wasn’t till after midnight that our plane landed; it was after 1 a.m. by the time I reached my hotel. Normally travel, when it runs late and long, makes me feel exhausted, but I was excited to be joining my first Drupal core sprint. I’ve been wanting to do a bit more to help build Drupal and it’s great to not only be somewhat aware of what’s coming in Drupal 8, but to also know that I’ve at least played a small part in making it happen.

I wasn’t sure I would attend the Drupal Dev Days in Barcelona till a couple of weeks ago, but I’m glad I’m here. We have a fairly sizable group of developers here at the Citilab helping work on cutting through the issues for Drupal 8 Multilingual Initiative (D8MI). I’ve been helping with some user interface quirks and since it had been long enough since I’d actually done string translations of the user interface, I started out yesterday as a “tester”… at least trying to look at the problem of translating the interface (e.g. translating “Add content” to German) as if I had never done anything like that before. And we did find some issues and, even better, we were able to address and correct those issues during yesterday’s coding. Others have been working on multilingual issues related to the new configuration management system, and a number of other issues which you, too, can help with, if you’d like to join us remotely (or in person, if you happen to already be in Barcelona — the Sprints continue through Friday, too). There are currently about 40 of us in the IRC channel for i18n and I'd say that at least half of those are working on the Sprint. There are about a dozen (give or take, since people are working on other sprints, too) who are here in Barcelona working on D8MI.

You can help make Drupal 8 better, too!

11 June 2012
Modules of the month story banner illustration.

In May 2012, 150 new Drupal modules were released; this post provides an overview of some of the most promising modules including developer APIs, theming tools, configuration assistants, useful enhancements to other modules and much more.

Going through the list of new modules, I found it difficult, this time, to select the “most useful”. Of course what seems “useful” depends largely on ones use case, so what you find indispensable, I might I find useless today, and tomorrow I might decide it’s a vital part of my new project. With one exception, the selected modules should all be reasonably “ready for use” (i.e. they at least have a release of some kind) and are mostly modules I could imagine using, myself, even if I don’t have an immediate need for many of them. Some modules which were not included in this selection include several "third-party integration” modules, especially those for “commercial” services. And in contrast to the post made for the April’s “modules-of-the-month”, I have not attempted to sort the selection of modules by category, but instead have the list sorted alphabetically, by project name—the summaries include the categories used on the modules’ Drupal.org project descriptions (and reasonable categories have been added for a few modules which currently haven’t got any categories selected on drupal.org).

As with last time, I have not been able to personally test all of the modules, so don’t blame me if you enable one that looks promising… and it hoses your database.

04 June 2012

It’s considered “best practice”, if a module creates any variables, to delete those variables in the module’s uninstall function. Before Drupal 7, this was done in a call to db_query(). But with the “new” DBTNG (Drupal 7 Database API), using db_query() is no longer recommended. See the documentation for db_query():

Do not use this function for INSERT, UPDATE, or DELETE queries. Those should be handled via db_insert(), db_update() and db_delete() respectively.

However, browsing through (a relatively small set of) Drupal modules I have for my local Drupal 7 installations, I still see a number of modules which are using db_query to delete variables, typically something like this:

<?php
  db_query
("DELETE FROM {variable} WHERE name LIKE 'some_module_%'");
?>

Let’s rewrite this fictional module’s call to db_query() to instead use db_delete():