Planet Drupal

Subscribe to feed Planet Drupal
Drupal.org - aggregated feeds in category Planet Drupal
Bijgewerkt: 10 uur 20 min geleden

Evolving Web: DrupalCamp NYC at the United Nations - Recap and Photos

di, 2014/04/22 - 11:52pm

This year's DrupalCamp NYC was held at the United Nations. The camp was crammed with summits and useful sessions and included a lot of content about Drupal 8.

read more
Categorieën:

Drupalize.Me: Webinar: Easily Create Maps with Leaflet

di, 2014/04/22 - 9:50pm

Curious about Leaflet? Join Drupalize.Me Trainer Amber Matz for a live tutorial on how to add Leaflet maps to your Drupal site during this Acquia hosted webinar on May 1, 2014 at 1:00 PM EDT.

Categorieën:

Dcycle: Simpletest Turbo: how I almost quadrupled the speed of my tests

di, 2014/04/22 - 9:15pm

My development team is using a site deployment module which, when enabled, deploys our entire website (with translations, views, content types, the default theme, etc.).

We defined about 30 tests (and counting) which are linked to Agile user stories and confirm that the site is doing what it's supposed to do. These tests are defined in Drupal's own Simpletest framework, and works as follows: for every test, our site deployment module is enabled on a new database (the database is never cloned), which can take about two minutes; the test is run, and then the temporary database is destroyed.

This created the following problem: because we were deploying our site 30 times during our test run, a single test run was taking over 90 minutes. Furthermore, we are halfway into the project, and we anticipate doubling, perhaps tripling our test coverage, which would mean our tests would take over four hours to run.

Now, we have a Jenkins server which performs all the tests every time a change is detected in Git, but even so, when several people are pushing to the git repo, test results which are 90 minutes old tend to be harder to debug, and developers tend to ignore, subvert and resent the whole testing process.

We could combine tests so the site would be deployed less often during the testing process, but this causes another problem: tests which are hundreds of lines long, and which validate unrelated functionality, are harder to debug than short tests, so it is not a satisfactory solution.

When we look at what is taking so long, we notice that a majority of the processing power goes to install (deploy) our testing environment for each test, which is then destroyed after a very short test.

Enter Simpletest Turbo, which provides very simple code to cache your database once the setUp() function is run, so the next test can simply reuse the same database starting point rather than recreate everything from scratch.

Although Simpletest Turbo is in early stages of development, I have used it to almost quadruple the speed of my tests, as you can see from this Jenkins trend chart:

I know: my tests are failing more than I would like them to, but now I'm getting feedback every 25 minutes instead of every 95 minutes, so failures are easier to pinpoint and fix.

Furthermore, fairly little time is spent deploying the site: this is done once, and the following tests use a cached deployment, so we are not merely speeding up our tests (as we would if we were adding hardware): we are streamlining duplicate effort. It thus becomes relatively cheap to add new independent tests, because they are using a cached site setup.

Tags: planetblog
Categorieën:

AGLOBALWAY: Drupal & Bootstrap

di, 2014/04/22 - 7:34pm
Here at AGLOBALWAY, we are constantly learning to take advantage of the myriad of tools available to us whether for communication, productivity, or development. As a company dedicated to all things open source, one of the tools we employ is Twitter’s Bootstrap framework. Thanks to the industriousness and generosity of companies like Twitter, (or Zurb for its own Foundation framework, among others), the web community has a tremendous amount of resources from which to draw upon.   Drupal has been a key content management framework for us ever since the inception of our company for its flexibility, power, and configurability. Bootstrap has made an excellent companion for Drupal in several of our projects so far, so I will highlight just a few of the many ways that a Bootstrap-based theme can compliment your Drupal website.   Bootstrapped Style   While some decry the design style and “look” that is quintessentially Bootstrap, there really is no need to. Yes, it has been a major influence on modern web design trends. Bootstrap has prepackaged layouts and default styles for nearly all UI elements, taking away the need to create styles for everything. But, building a unique site that doesn’t follow that typical Bootstrap style own doesn’t have to be difficult. The real undertaking is in learning the ins and outs of the preprocessor system employed by Bootstrap (Less, in this case), and how they have laid everything out.   Once familiar with the system, one will quickly realize that it’s relatively straightforward to take advantage of all of the mixins and variables already given in order to generate the styles you have designed. In one .less file, we can quickly define colours, sizes, and other default settings that will appear throughout your site. Again, like the JavaScript libraries above, this is not unique to Drupal. However, being able to take advantage of these tools helps immensely to speed up the development cycle of building Drupal sites.   JavaScript Libraries   Having access to a number of common functions used throughout the web is a huge time saver. Already bundled with jQuery, a Drupal Bootstrap-based theme allows for easy integration of accordions, image carousels and more, without having to write your own JavaScript. While these libraries are certainly not exclusive to Drupal, there can be unique ways of making use of them with Drupal. For example, rendering a block inside of a modal for a login form is a snap, and css is all you really need to customize it once you initialize it with the proper JavaScript.   Another example would be to pair Bootstrap with the popular CKEditor module to generate templates, using Bootstrap’s markup. Users may want to place an accordion inside their own managed content, so we can create a template with CKEditor’s default.js file (even better, create a separate file and use that one instead), following the pattern of the templates already given. Add the Bootstrap markup with the appropriate classes, and voila! Your users now have an accordion they can insert using only the WYSIWYG editor.   Bootstrap Views   This is a Drupal module I have yet to really play around with personally, but a cursory look tells me just how easy it can be to display content using Bootstrap elements without even getting into template files or writing code. While I generally prefer to separate markup from data output, I can see the potential here for a lot of time saving, while avoiding some head-scratching at the same time. This is the whole point of views in the first place - making it easy to display the content you want without having to dive too deep.   As we can see, integrating Drupal with Twitter Bootstrap has considerable advantages. While its heaviness is a fair criticism, I believe those advantages justify the use of Bootstrap, particularly in an Agile development environment. Besides, we can always eliminate the JavaScript or CSS we don’t use once we’re done developing our site. Whether it’s Bootstrap, Foundation, or your framework of choice, having such front-end tools to integrate with Drupal can only be a good thing. Many thanks to all who are dedicated to creating and maintaining these resources for the benefit of us all. Tags: drupal planetBootstrap
Categorieën:

Propeople Blog: Propeople at Stanford Drupal Camp 2014

di, 2014/04/22 - 7:26pm

This past weekend, some of our team had the pleasure of attending Stanford Drupal Camp, which Propeople supported as a Gold Sponsor. Stanford University is one of the biggest advocates of Drupal in higher-education, and is home to an active and passionate Drupal community. Hosted on the world famous (and too-gorgeous-to-put-into-words) Stanford campus, the Stanford Drupal Camp is an annual event focused on Drupal and the state of Drupal at the university (where thousands of websites are powered by the CMS). Propeople has participated in the event the past few years, and we've had the pleasure to work on a wide variety of Stanford projects in the same amount of time. These include the Stanford Graduate School of Business, SLAC National Accelerator Laboratory, Stanford Student Affairs, Riverwalk Jazz, and many others. 

Stanford Drupal Camp featured a great line-up of sessions and talks all day Friday and Saturday, ranging from the simple to the complex. The talks focused on a variety of topics, from site building to Agile and Scrum methodology to specific Drupal use cases in higher education. As you can expect at any Drupal camp, more casual BoFs and lightning talks were interspersed throughout the conference.

We were happy to have the packed schedule include two sessions presented by one of Propeople’s own Drupal experts, Yuriy Gerasimov, on Saturday. Yuriy’s first session was titled “CI and Other Tools for Feature Branch Development”, aimed at helping developers and organizations implement feature-branch workflow. The second was “Local Development with Vagrant”, which, as you might have guessed from the title, was all about the benefits of using Vagrant to spin up local virtual machines with the same settings on different platforms.

 

 

Overall, the many sessions, BoFs, and lightning talks provided Stanford staff, faculty, students, and developers (from the university and beyond) with plenty of great information.

In addition to the full session schedule, Stanford Drupal Camp featured plenty of opportunities for those at the event to enjoy each other’s company, catch up, and engage in some great conversation about every attendee’s favorite topic...Drupal! As a technology partner to more than a dozen Stanford departments and institutions, Propeople has learned first hand how great the Stanford community is, and it was a treat to have some of our team on campus to join in on the fun at Stanford Drupal Camp. We’ll be looking forward to next year!

Tags: DrupalDrupal campStanfordCheck this option to include this post in Planet Drupal aggregator: planetTopics: Community & Events
Categorieën:

Phase2: Exploring Maps In Sass 3.3(Part 3): Calling Variables with Variables

di, 2014/04/22 - 7:25pm

For this blog entry, the third in a series about Sass Maps, I am going to move away from niche application, and introduce some more practical uses of maps.

Living Style Guides

In my current project, a large Drupal media site,  I wanted to have a style guide, a single static page where we could see all of the site colors, along with the variable name. I collected all of my color variables, and created some static markup with empty divs. Below is the loop I started to write.

<!-- The HTML for our Style Guide --> <div class="styleguide"> <div class="primary-color"></div> <div class="secondary-color"></div> <div class="tertiary-color"></div> </div>

// Our site color variables $primary-color: #111111; $secondary-color: #222222; $tertiary-color: #333333; // Make a list of the colors to display $styleguide-colors: primary-color, secondary-color, tertiary-color; // Loop through each color name, create class name and styles @each $color in $styleguide-colors { .styleguide .#{$color} { background-color: $#{$color}; // Spoiler Alert: Does not work!! &:after { content: “variable name is #{$color}” } } }

This loop goes through each color in my $styleguide-colors list and creates a class name based on the color name. It then attempts to set the background-color by calling a variable that matches the name from the list. We also set the content of a pseudo element to the variable name, so that our styleguide automatically prints out the name of the color.

This is what we want the first loop to return:

.styleguide .primary-color {  background-color: $primary-color; // Nope, we won’t get this variable  &:after {      content: “variable name is primary-color”    } }

The problem is that we can’t interpolate one variable to call another variable! $#{$color}  doesn’t actually work in Sass. It won’t interpolate into $ + primary-color , and then yield #111111  in the final CSS. This 3 year old github issue points out this exact issue, and hints at how maps is going to be introduced in Sass 3.3 to solve this problem. https://github.com/nex3/sass/issues/132

Make it better with maps

So now that we have maps, how can we create this color styleguide? Lets take this a step at a time.

First we need to wrap all of our colors in a map. Remember, any of these colors can be accessed like this: map-get($site-colors, primary-color)

$site-colors: (  primary-color: #111111,  secondary-color: #222222,  tertiary-color: #333333, );

Now we can create a list of the colors we want to iterate through and loop through them just like we did before.

$styleguide-colors: primary-color, secondary-color, tertiary-color; @each $color in $styleguide-colors {  .styleguide .#{$color} {    background-color: map-get($site-colors, $color); // This DOES work!    &:after {      content: “variable name is #{$color}”    }  } }

This time when we loop through our colors we get the same class name and pseudo element content, but lets look at what happens with the background color. Here is the first pass through the loop, using primary-color as $color :

.styleguide .primary-color {   background-color: map-get($site-colors, primary-color);   &:after {      content: “variable name is primary-color”    } }

As you can see in this intermediate step, we are able to use map-get($site-colors, primary-color)  to programmatically pass our color name into a function, and get a returned value. Without maps we’d be stuck waiting for $#{$color} to be supported (which will probably never happen). Or in the case of my project, write all 20 site color classes out by hand!

Make it awesomer with maps

Astute readers might realize that I am still doing things the hard way. I created a map of colors, and then duplicated their names in a list called $styleguide-colors . We can skip that middle step and greatly simplify our code, if we are wanting to print out every single value in the map.

$site-colors: ( primary-color: #111111, secondary-color: #222222, tertiary-color: #333333, ); @each $color, $value in $site-colors { .styleguide .#{$color} { background-color: $value; &:after { content: “variable name is #{$color}” } } }

Now, instead of passing a list into the @each loop, we pass the entire map. We can do this with the following pattern: @each $key, $value in $map . Each iteration of the loop has access to both the key primary-color  AND the value #111111 , so we don’t even need the map-get function.

The ability to ‘call variables with variables’ is incredibly useful for creating these programmatic classes, and is a foundational process upon which we start to build more complex systems. Be sure to check out part 1 and 2 of my Sass Maps blog series!

Categorieën:

Gábor Hojtsy: Drupal Developer Days 2014 Organizers Report

di, 2014/04/22 - 6:21pm


The organizer team is still energized after our experience putting together Drupal Dev Days Europe 2014 in Szeged, Hungary between 24 and 30 March.

Several people asked about details and we wanted to document the event for future event organizers to share what worked best for us. We prepared a report for you so if you experienced Drupal Dev Days Szeged, you can look behind the curtain a bit, or if you heard about it, you can see what we did to pull off an event like this. If you were not there and did not hear about it, we included several feedback references as well to give you an idea.

Do you want to see tweets and articles like those about your event? Read the report for our tips!

We definitely did not do everything right but we hope we can help people learn from the things we did right.

Excuse us if the report is a bit too long, we attempted to pack useful information to every single sentence to make reading it worth your time. Send questions and comments to the team.

Categorieën:

Acquia: I’m Kris Vanderwater, Drupal Developer and Acquia’s Developer Evangelist.

di, 2014/04/22 - 5:01pm

I’ve been working at Acquia for a little over two weeks now. The experience has been one I would characterize as “whirlwind” in nature. If you ask new Acquians about their on-boarding experience, the most common comparison is the age old “Drinking from a firehose” analogy. I honestly expected, as someone who already knew Drupal, that this might in some way lessen the stream of information to manageable levels. I was wrong. If anything the fire hose is a bit like sticking your toes into the shallow end of the pool, and knowing Drupal already was like “Oh you know how to swim?

Categorieën:

Frederick Giasson: Configuring and Using OSF Ontology (Screencast)

di, 2014/04/22 - 3:47pm

This screencast will quickly introduce you to ontologies, and will explain you what are their rules in the Open Semantic Framework (OSF).

You will see how you can manage ontologies in OSF using the OSF for Drupal web interface. You will be able to import, create, update, delete and export ontologies. You will see how you can search within imported ontologies, how you can manage their permissions.

Finally you will see how you can manage the ontologies themselves: how you can create, update and delete classes, properties and named individuals using the Web user interface.



Categorieën:

Vasily Yaremchuk: Don't forget to check Backup&Migrate settings after D6 to D7 upgrade!

di, 2014/04/22 - 1:41pm

Several days ago we upgraded simple Drupal 6 site to Drupal 7. After core upgrade process was finished we turned on all necessary modules such as Admin menu and Backup & Migrate.

Some features required custom update by scripts and some manual work, we made backup before this activity.
... something went wrong and we go back by restoring DB via Backup&Migrate module and site wend down :-(

When we took a look on DB backup script we found that there was empty dump with the structure of some tables.
So as a result the data in several tables was killed.

When we repeated upgrade process again and took a look on Backup&Migrate advanced settings we were shocked

By some reason all tables was excluded from backup.

After we align B&M settings backup became works correctly :-)

The main idea of this post due to automatic upgrade process you should double check settings of contributed modules, upgrade can make them different according initial state.

And, of course, backups is necessary part of site development activity but you should be sure that your backups correct.

Blog tags:
Categorieën:

Open Source Training: Personalized Content Feeds in Drupal

di, 2014/04/22 - 12:02pm

One of our members wanted to allow users to create customized information feeds in Drupal.

In this tutorial, we'll show you how to do that.

We'll show you how to allow users to choose only certain types of content to show. This could be useful for news sites, but also for many other types of site where users want personalized content.

In this example, we're going to create a list of movies that will only show genres that the user chooses.

Categorieën:

blog.studio.gd: Create automatic URL alias in drupal

di, 2014/04/22 - 10:22am

Every time you create a site with drupal you may add a new contextual tab for a node or for a user. if you have used pathauto to create automatic (multilangual) aliasing of user and node url, so on, you got good urls for SEO ! But your custom module urls must also be optimised for search engines.

For the example we create a node type called article, and we add a two custom url : Poll and Photos.

/** * Implements hook_menu(). */ function module_name_menu() { $items = array(); $items['node/%node/poll'] = array( 'title' => 'Poll', 'page callback' => 'module_name_poll_page_view', 'page arguments' => array(1, 2), 'access callback' => 'node_access', 'access arguments' => array('view', 1), 'type' => MENU_LOCAL_TASK, ); $items['node/%node/photos'] = array( 'title' => 'Photos', 'page callback' => 'module_name_photos_page_view', 'page arguments' => array(1, 2), 'access callback' => 'node_access', 'access arguments' => array('view', 1), 'type' => MENU_LOCAL_TASK, ); return $items; }

With pathauto enabled, we have a customisable, translatable pattern url for the node page :
http://example.com/node/245
that became
http://example.com/content/article-title

BUT

http://example.com/node/245/poll and http://example.com/node/245/photos
stay
http://example.com/node/245/poll and http://example.com/node/245/photos

To fix that issue you can implement the pathauto api to create custom URL patterns :

/** * Implements hook_pathauto(). */ function module_name_pathauto($op) { switch ($op) { case 'settings': $settings = array(); $settings['module'] = 'module_name'; $settings['token_type'] = 'node'; $settings['groupheader'] = t('Module_name node paths'); $settings['patterndescr'] = t('Default pattern'); $settings['patterndefault'] = ''; $settings['batch_update_callback'] = 'module_name_pathauto_bulkupdate'; $path = array( 'module_name_node_poll' => 'Module_name poll path', 'module_name_node_photos' => 'Module_name photos path', ); $langs = array_keys(language_list()); foreach ($path as $k => $p) { foreach ($langs as $lang) { $path[$k . '_' . $lang] = $p . ' for language ' . $lang; } unset($path[$k]); } $settings['patternitems'] = $path; return (object) $settings; } }

The custom pattern are done. More example for the implementation of this hook

When a new node is created, updated or deleted the alias must be updated or deleted, to do that we use the hook provided by drupal :

/** * Implements hook_node_insert(). */ function module_name_node_insert($node) { module_name_create_alias($node, 'insert'); } /** * Implements hook_node_update(). */ function module_name_node_update($node) { module_name_create_alias($node, 'update'); } /** * Implements hook_node_delete(). */ function module_name_node_delete($node) { module_load_include('inc', 'pathauto'); pathauto_path_delete_all('node/' . $node->nid . '/poll'); pathauto_path_delete_all('node/' . $node->nid . '/photos'); } /** * Module_name create alias for a node custom urls. */ function module_name_create_alias($node, $op) { $langs = array_keys(language_list()); module_load_include('inc', 'pathauto'); foreach ($langs as $lang) { pathauto_create_alias('module_name', $op, 'node/' . $node->nid . '/poll' , array('node' => $node), 'module_name_node_poll_' . $lang, $lang); pathauto_create_alias('module_name', $op, 'node/' . $node->nid . '/photos' , array('node' => $node), 'module_name_node_photos_' . $lang, $lang); } }

To generate/update your urls alias with the bulk update interface or with drush there is callback defined in the hook_pathauto : "batch_update_callback" :

/** * Implements hook_pathauto_bulkupdate. */ function module_name_pathauto_bulkupdate() { if (!isset($context['sandbox']['current'])) { $context['sandbox']['count'] = 0; $context['sandbox']['current'] = 0; } $query = db_select('node', 'n'); $query->addField('n', 'nid'); $query->leftJoin('url_alias', 'ua', " ua.source LIKE CONCAT('node/', n.nid, '/%')"); $query->isNull('ua.source'); $query->condition('n.nid', $context['sandbox']['current'], '>'); $query->orderBy('n.nid'); $query->addTag('pathauto_bulk_update'); $query->addMetaData('entity', 'node'); // Get the total amount of items to process. if (!isset($context['sandbox']['total'])) { $context['sandbox']['total'] = $query->countQuery()->execute()->fetchField(); // If there are no nodes to update, the stop immediately. if (!$context['sandbox']['total']) { $context['finished'] = 1; return; } } $query->range(0, 25); $nids = $query->execute()->fetchCol(); $nodes = node_load_multiple($nids); foreach ($nodes as $node) { module_name_create_alias($node, 'bulkupdate'); } $context['sandbox']['count'] += count($nids); $context['sandbox']['current'] = max($nids); $context['message'] = t('Updated alias for node @nid.', array('@nid' => end($nids))); if ($context['sandbox']['count'] != $context['sandbox']['total']) { $context['finished'] = $context['sandbox']['count'] / $context['sandbox']['total']; } }

The code is over, you can fill the pattern in your site administration : admin/config/search/path/patterns
Let the default pattern blank and fill for each language and tabs the good patterns, example : "content/[node:title]/poll"

Categorieën:

DrupalCon Amsterdam: Hallo from Amsterdam!

di, 2014/04/22 - 8:10am

DrupalCon Amsterdam is coming soon, and I can’t wait to welcome the Drupal community to this wonderful city. The conference is shaping up to be an absolutely incredible experience.

The local Dutch Drupal community has been hard at work coming up with a huge number of fun and cultural activities. From the Tour de Drupal bike ride from London to Amsterdam, to the Drupal bar crawl up and down the canals; DrupalCon Amsterdam is going to be a great place to learn more about Drupal, celebrate the community, and have a fantastic time.

Make sure you buy your ticket and reserve your hotel room as soon as possible, so you can get the best prices. In the coming weeks, we’ll be rolling out more information about the convention, sponsorship opportunities, and more.

The website is now live, so get your tickets here!

--
Baris Wanschers
Chairman, Stitching Drupal Nederland

Categorieën:

Károly Négyesi: The Simpletest sprint six years ago

di, 2014/04/22 - 7:14am

As the Simpletest sprint in Paris was exactly six years ago I feel it's a good time to remind the community how and why Simpletest was chosen especially in the light of the Simpletest hate lately. At that time we had almost no tests (compared to the massive test battery today with over 68 000 asserts) and it was paramount to allow anyone to be able to write and run tests. Drupal in 2008 was not really API driven and so we needed browser based testing. Selenium at this time (Selenium 2 / WebDriver was released in 2011) required a standalone Java program to drive a browser -- we didn't quite feel being a Java-on-your-desktop helpdesk. So Selenium was out. PHPUnit offered a big fat nothing for Drupal -- Rok and I actually printed the source code out and read the whole thing at Boston DrupalCon and found nothing useful in there. Mind you, it was a very young project at that time. Behat? Mink? In 2008? Come on, Cucumber itself didn't appear until 2008 fall. So. In 2014 it is easy to say there are better and/or faster alternatives but those weren't there in 2008. Also, it's the massive refactoring in Drupal 8 that made it possible to use PHPUnit -- but guess what made the refactoring possible.

Categorieën:

Web Wash: Control Context Using Context Entity Field in Drupal 7

ma, 2014/04/21 - 11:27pm

When you need to dynamically display a block within a region, nothing can really beat the Context module. It allows you to define a set of conditions, that when met, executes a set of reactions. For example, you could create a context rule which adds a block to the sidebar second region (reaction) when a user is viewing an Article content type (condition).

A lot of what Context does can also be achieved using Panels. But if you're new to Drupal, and never used Panels than Context will be easier to use.

If you're new to Context then I would highly recommend you watch the two introductory videos below:

Recently I've discovered a powerful module called Context entity field. It allows you to define a condition that checks the value of a field on an entity.

Categorieën:

Drupal core announcements: This week (or two or three) in Drupal Core

ma, 2014/04/21 - 10:02pm
What's new with Drupal 8? Configuration system changes

Over the past month, a lot of work has gone into the configuration system. With the addition of a separate module install/uninstall step for the config import process, it's finally possible to properly synchronize configuration changes with module installations or uninstallations. You can now transform a site installed with the Minimum install profile into a site using the Standard install profile by importing configuration (the case we've long said will be our indicator that CMI "works"). (Watch this screencast to see it in action!)

Additionally, after thorough discussion, the active storage for the configuration management system has been moved into the database by default. This means existing Drupal 8 sites will likely need to be reinstalled (or otherwise migrate the active configuration). Read the change record on active configuration in the database for details on why this decision was made.

Now is the time to start really testing CMI deployments. Spin up a dev site, make a copy of it, and test synchronizing complex configuration system changes between the two. See if the system behaves as you expect (and report the problems you find!) For an overview of the outstanding work being done on the configuration system, see #2187339: [meta] CMI path to beta.

NYC Camp at the United Nations


The third annual NYC Camp was held at the United Nations. (Yes, that United Nations, with the flags.) In addition to numerous sessions about Drupal 8 (check out fmitchell's session on 30 Drupal 8 API functions you should already know), we held several days of Drupal 8 core sprints. Media contributors also sprinted on Media for Drupal 8; check out their sprint status report for more information. Finally, Drupal Association executive director Holly Ross worked on a Drupal 8 patch got her first Drupal core commit credit! Are you next? :)

Where's Drupal 8 at in terms of release?

We're in the last stretch of Drupal 8's alpha phase. We've fixed over 130 beta-blocking issues, including 9 in the last week, plus written more than 70 missing change records. The last 28 beta blockers include some difficult issues, but consider some of what we've already accomplished since the beginning of 2014:

  • The removal of the variable subsystem after 18 months.
  • The rearchitecture of configuration synchronization to support the minimum viable usecase after 16 months.
  • The removal of the legacy menu router after nearly a year.
  • The removal of widely used cache-breaking functions including drupal_set_title(), drupal_add_css(), drupal_add_js(), and theme().
  • The removal of all stale hook_update_N() implementations and the modification of update.php to require Migrate for major version upgrades instead.

(And of course so much more.)

Where can I help? Top criticals to hit this week

Each week, we check with core maintainers and contributors for the "extra critical" criticals that are blocking other work. These issues are often tough problems with a long history. If you're familiar with the problem space of one of these issues and have the time to dig in, help drive it forward by reviewing, improving, and testing its patch, and by making sure the issue's summary is up to date and any API changes are documented with a draft change record.

  • #2116363: Unified repository of field definitions (cache + API) converts remaining usages of the deprecated field info API to use methods from the entity manager, and is therefore critical to stabilizing the Entity Field API for the beta release. This significant (~150 KB) patch needs thorough code review from contributors familiar with Drupal 8's entity and field systems.

  • #2183231: Make ContentEntityDatabaseStorage generate static database schemas for content entities is an even larger (~250 KB) beta-blocking patch for the entity system that allows the entity system to automatically create the necessary database tables for entities, resolving numerous different issues. This is another significant change and needs lots of thorough review from as many people as possible.

  • #2198429: Make deleted fields work with config synch needs review of the patch's architecture and functionality. Deleting a field is a significant operation, because the site has to go on to purge all the field instance data for entities that have the field while leaving those entities intact. Drupal 7 includes a lot of code to support this functionality, and in Drupal 8, there's additional complexity since this purge needs to happen when a deleted field is staged and synchronized to another environment.

  • #2124749: [meta] Stop using request attributes as a storage mechanism for other services covers a collection of issues to improve the developer experience around Drupal 8's use of Symfony's request attributes (a public property on the request object that can be used for context-specific information about the request). This context information is not easily discoverable for contributed module developers, and, in some cases, using it adds to the apparent verbosity and complexity (e.g. in the replacements for the common D7 functions menu_get_object() and menu_get_item()). The numerous sub-issues for this meta issue are intended to weed out misuses of the request attributes and provide clear public APIs for others. Help discuss the developer experience and architecture in the numerous child issues for this meta.

More ways to help Notable Commits

The best of git log --after=2014-04-02 --pretty=oneline (207 commits in total):

Configuration management

As we described above, it's been another couple weeks of fantastic progress in getting the configuration management system solid for beta. Notably:

  • Issue #2161591 by pwolanin, beejeebus, sun: Change default active config from file storage to DB storage.
  • Issue #1808248 by alexpott, beejeebus, tayzlor, Nitesh Sethia: Add a separate module install/uninstall step to the config import process.
  • Issue #2124535 by Berdir, alexpott, Désiré, xjm | yched: Prevent secondary configuration creates and deletes from breaking the ConfigImporter.
  • Issue #1740378 by xjm, Désiré, alexpott | heyrocker: Implement renames in the import cycle.

There is still plenty to help out on in the CMI path to beta meta issue if you want to help keep the excellent momentum of the last few weeks going.

Entities and fields

One of the many accomplishments from Drupal DevDays a few weeks ago, was a cute and colorful visualization of the long dependency chain of issues remaining to stabilize the Entity and Field APIs for beta. Two of them were committed in the last two weeks:

  • Issue #2225739 by killua99, Berdir, andypost, pfrenssen: Remove usage of field_info_instances(), use EntityManager::getFieldDefinitions() instead.
  • Issue #2226197 by fago, jessebeach: Introduce FieldStorageDefinitionInterface in the Entity Field API.

That has unblocked Unified repository of field definitions, which is now making good progress, and when committed, will unblock the next level of the dependency chain.

Migration

With a Drupal 8 beta approaching, how exciting will it be to start testing it out with content and configuration from an existing Drupal 6 site?! Several issues were committed that pave the way for that, including:

  • Issue #2211949 by chx, Berdir, fago, benjy: Support keeping new revision id for migrate.
  • Issue #2190561 by chx, pcambra, benjy: Migrate in core: Add a load system for migrate plugins.

And now, there's a 600KB patch containing 82 actual migrations ready for review.

A meta for everyone

No matter what part of Drupal you're interested in, there's probably a meta issue available for you to chip away at. Here's just some of the ones that had a commit in the last two weeks.

Front-end
  • When creating a theme, just when you thought you overrode everything you needed to to get all your markup exactly how you like it, do you hate having to discover yet another obscure theme function that inserts an unwanted <div>? Well, the Twig team is cleaning that up as part of converting theme functions to Twig. Congratulations to them for removing a function entirely in: Issue #2151123 by joelpittet | Cottser: Remove theme_system_modules_incompatible().
  • What's even better than fewer one-off theme functions to override? How about default markup that's perfect to begin with? There's a meta issue and an issue tag for that. Yay for progress on that with: Issue #2226923 by pakmanlh, mandar.harkare, mortendk, galooph: Views: remove wrapper around more link - add class to the link.
  • Great default markup is only half the battle. We need great default CSS to go along with it. Nice to see another issue completed on that: Issue #1662954 by balis_m, mjonesdinero, kalpaitch, IshaDakota, kerasai, ckrina, BarisW | ZenDoodles: Use less-specific tabledrag selectors.
  • And let's not forget about Javascript. In Drupal 8, we've incorporated some fantastic JS libraries. It's important that we keep up with their updates, including: Issue #2192383 by tstoeckler: Update jQuery to 2.1.0.
Back-end

You can also always check the Change records for Drupal core for the full list of Drupal 8 API changes from Drupal 7.

Drupal 8 Around the Interwebs

Blog posts about Drupal 8 and how much it's going to rock your face.

Drupal 8 in "Real Life"
  • First off, there are numerous upcoming sprints in Washington, DC (April 22), Brisbane (April 23), London (April 26-27), and Stockholm (May 4), plus a Drupal 8 Search API sprint in Zurich (April 28-May 2). Try working on a Drupal 8 core or contrib issue at one of these sprints!
  • April 23-25: DrupalCamp Mexico has several Drupal 8-related sessions and a whole "SymfonyDay" track!
  • April 25-27: DrupalCamp Donetsk will include a presentation on Drupal 8 from webchick.
  • April 26: DrupalCamp St. Louis also includes a Drupal 8 introduction.
  • May 2: DrupalJam in the Netherlands has a session on Drupal 8 patterns (plus maybe a streamed Q&A with Dries!)
  • May 2-4: DrupalCamp Toronto doesn't have a set schedule yet, but there are numerous Drupal 8 session proposals.
  • May 31-June 8: DrupalCon Austin and extended sprints. This year's North American DrupalCon will include many Drupal 8 sessions, trainings, and sprints. The conference is June 2-6 with the community sprint on Jun 7, and there are plans extended sprints the weekends before and after the conference. See the signup sheet for Austin's extended sprints. Austin will be critical to make progress toward Drupal 8's release, so please plan to participate in the sprints if you can!
Whew! That's a wrap!

Do you follow Drupal Planet with devotion, or keep a close eye on the Drupal event calendar, or git pull origin 8.x every morning without fail before your coffee? We're looking for more contributors to help compile these posts. You could either take a few hours once every six weeks or so to put together a whole post, or help with one section more regularly. Contact xjm if you'd like to help communicate all the interesting happenings in Drupal 8!

Categorieën:

Janez Urevc: DrupalCamp Alpe-Adria - ticket prices go up in only 4 days!

ma, 2014/04/21 - 7:22pm

DrupalCamp Alpe-Adria will be one of the most scenic Drupal events this spring in Europe. It will take place in a magnificent costal town Portorož, which is conveniently located in the northern part of Adriatic sea.

Camp will happen on 17th and 18th May with extended sprints happening also on 19th and 20th. We already have some great session proposals and new ones are coming in almost every day! Are you new to Drupal? No problems! We're preparing some very interesting beginner-level sessions and on-site trainings. For those who prefer to code we have some very interesting sprints to offer! There will be Drupal 8 core and Drupal 8 media sprints going on. Are you interested in organizing another sprint? Do not hesitate to contact us immediately!

Early bird tickets are available only until 25th April. Don't miss your last chance to get them and start planning your travels well in advance. Portorož is very nice for families and children so you should really consider bringing your significant others with you and maybe extending Drupal camp into a short spring vacation.

Categorieën:

Drupal Association News: Continuous Integration Efforts Get Easier with Drupal 8

ma, 2014/04/21 - 4:20pm

At MidCamp (Midwest Drupal camp), I found out a really fascinating thing about Drupal 8: Support for PHPUnit is going to be part of the base distribution. This means a great deal to Solutions Architects and Developers at Promet because we have been striving to integrate automated tests into our build. Perhaps you remember from my talks or previous posts, number four of my 10 Principles of Continuous Integration is "Self-Testing Build". This makes Drupal a much more sought-after platform for shops looking to fully embrace Continuous Integration.

What do we do now?

Currently, Promet uses PHPUnit for testing purposes. Our team (Michelle Krejci and Will Milton), have instituted the use of Behavioral Driven Development (BDD) using Travis-CI, Behat, Mink, PhantomJS, and PHPUnit. This provides our requirements, use-cases and a way to easily self-code-review. For those not familiar with Gherkin, I urge you review it. It's a simple process to write use-cases in English, such that someone can program tests against it. The confidence this has given our team in our quality of code, and the confidence the client has in the outcome is phenomenal.

Michelle can attest to this being the case. In a project she’s working on now, the tests are actually being used to get sign-off that work is complete. All of the tests were created ahead of time and the scenarios are added as needed; therefore, change orders are obvious because the tests are in version control. There is no question on what scenarios we are supporting, when one was added, or when a piece of work is completed to the specifications.

So how do we improve on BDD?

The problem with this workflow is that we have to jump to the Functional Test level to test anything at all. In terms of testability, it’s a tiny improvement compared to the Simple Test workflow Drupal has now. However, we have seen improvement since we’ve moved from Selenium to PhantomJS. As you probably know, PhantomJS and Selenium both do browser testing.

Selenium is a browser “driver”. Through javascript injection, it hooks into a browser allowing you to emulate a user “doing stuff” on a webpage. However, running those browsers is super slow. The startup time alone for each test is over a second… sometimes up to 5 or 6. Who has that kind of time?

In the case of PhantomJS though, we aren’t testing specific browsers. In fact, PhantomJS is a browser, and a mighty fast one at that. This is fine for Promet where it is less significant whether specific browsers function a certain way. PhantomJS has improved our performance for testing over Selenium by strides.

But there is something even better! Testing at a Unit Level!

 

 

Drupal has been nearly impossible until Drupal 8. We had the Simple Test framework that was baked into Drupal, but it did what I like to call the "Use a Car to Test Another Car" approach. Specifically, you had to have a full instance of Drupal running so that it could make a fake instance of Drupal so that you could test. Additionally, functional code isn't very encapsulated. That is, you can't specifically say, "My inputs are xyz, and my outputs are abc.". The lack of encapsulation is mostly due to frequent use of global variables and not being able to group functionality with data like you can with objects in Object Oriented Programming (OOP).

Fear not. The new object oriented framework gives us easy access to new-fangled Dependency Injection, mocking of objects, and other programming patterns that allow us to consolidate a single unit of code. In our case, a unit is a single function within a class, which is the smallest unit of code that can be tested using PHPUnit.

This inspires developers to not only write better, testable code, but in smaller testable units that are...(insert drumroll, please) Reusable, not to mention, easier to test.

So how does Unit Testing make things easier?

In several situations, we could rid ourselves of functional tests altogether. If every single piece of a component is working as expected, then the sum of those parts would equal a feature that works as expected. Lastly, those tests run a couple of orders of magnitude faster than the PhantomJS tests. This means that the tests can easily be part of the build script and not just something that runs on Travis-CI.

Speaking of Travis-CI, now we can integrate Travis-CI directly with Drupal. No more hacking the pieces together to get a testable environment outside the box.

Final Thoughts

Overall, BDD is still flippin’ awesome and has its place in projects; we will still continue to use it. BDD is great for communicating directly with the client with something testable. However, Unit tests will allow us to build a set of reusable code at a lower cost to maintain. These unit tests allow us to better gauge our quality of code. I think these facts, speaking strictly as a Developer, will improve upon the testing process that we already have in place, particularly for our migrations and more technical projects with APIs and integrations. Looking into the future and our use of Drupal 8, I am excited for the availability of new unit test results to be used as insurance to our clients to backup our claims of quality. Developers happy and clients happy? Yes please! Thank you, Drupal 8.

Categorieën:

Mark Koester: Building Mobile Apps for Drupal Conference Sites

ma, 2014/04/21 - 4:15pm

I'm excited to announce that we've built our first Drupal-powered apps for iOS and Android. The apps are in the Android and Apple marketplace and are helped to improve one association's yearly technical conference.

There are times when apps are overkill and unneeded. Frankly there are already too many apps out there. But as we as a company continue to focus on conference sites, this was an obvious use case where taking the plunge into mobile app development made sense. It’s nearly become standard to have an event app at major conferences around the world.

At events, internet connectivity isn't that reliable and attendees, speakers and organizers are able to navigate the event much easier with the right mobile tool. Conference sites provide more media attention for sponsors and also provide various ways for networking.

In this post, I'd like to discuss our recent work building two mobile apps---one for Apple iOS and another for Google Android. Specifically in this post we’ll look at what we built, and in a future post, we’ll look at how we built these apps using different technologies (Drupal, iOS and Android) as well as some technical and business takeways we gained from this process of integrating a CMS like Drupal with a mobile device.

Let's take a look at what we've built.

Drupal-Powered Conference Sites

One of our main focuses over the last several years has been event and conference sites.

Drupal handles content, users and commerce with increasing sophistication and flexiblity. In Drupal 6, we used COD to build club and simple event management systems. In Drupal 7, we decided to shift away from COD and Ubercart and have been building our own events registration system using Panopoly, Drupal Commerce and Registration.

The first fruit of this work was a romance writers conference that last year took some 150+ orders in the first 10 minutes for signup. This year the same event was even more rapid fire and took 200+ orders in the first 3 minutes after registration opened!

We love building Drupal sites for events so much that we are, in fact, also working on our first alpha release for this platform called "Events for Drupal".

Along with that site, this past year we've gotten the chance to test and refine the system on other projects.

Several months ago, SPE Environomental Division came to us to overhaul their site to better deal with their yearly event, GPEC (Global Plastics Environmental Conference). Specifically, we cleaned up their legacy content and sessions and built a clean flexible design and layout. We organized their content and products around their yearly event and we empowered them to handle their own ecommmerce needs and registrations.

Along with a full upgrade to handle registration and paid sponsorship, we overhauled their session and awards submissions processes. Potential speakers could submit their abstracts months before the event and admin could manage it from approval to scheduling and room assignment. This allowed them to create a dynamic schedule and, most importantly for their app, to make their content available for mobile distribution.

So, with the content exposed via an API, what did we build?

What We Built: A Conference App with a Drupal Backend

To be honest, it's not that uncommon to see conference apps these days. It's one of the easier mobile use cases to build for. (There are even several companies that provide a platform for generating your own apps for events, like Guidebook.)

Most conference or event apps provide the following features: event schedule, session and speaker info, venue maps and various "about" pages as well as perhaps a facebook or twitter feed.

We wanted to have all of this along with one key additional change: it needed to be dynamic. In particularly, we wanted a dynamic "my schedule" functionality; a way that the user could mark sessions they wanted to go to and a dynamic my schedule display. This "marking attendance" needed to be available and synced on either the site or app. This would then allow the "my schedule" page to be seen on the app, in the site or even in an exportable and printable format.

In the Drupal world, there are also several conference apps. There is nearly a new app for each DrupalCon. These apps provide attendees with the schedule and other event info. While these "Drupal" apps are quite helpful, they are in most cases static. The event content (sessions, rooms, speakers, etc) was exported and simply built into a page-by-page functionality. Some do provide data pulls but I didn't see any that went far into the functionality we wanted, like login and “flagging” sessions to attend.

In many cases this static format is enough, but we felt that these apps missed out on providing a more dynamic and interactive experience. In big events with dozens or hundreds of sessions, a conference without a personalized user schedule is not that helpful. Many attendees end up using a paper version for the simple ability to circle and markup the sessions they want to go to.

As such, we took the more dramatic choice to build a dynamic app integrated into the website's backend.

This approach allowed us to provide a way for attendees to download the most up to date session info (meaning you didn't have to wait to download a revised version of the app itself, just the content). Event administrators could change the session info even minutes before the event and users could update and see it.

The method also allowed attendees to create and manage their own schedule. Users could mark sessions they wanted to attend either via the site or one of the apps. They could then view their personalized schedule both before and during the conference. From a user perspective this was a huge success.

From administrative side, since the attendence data was synced with the site, it also gave the event organizers some rough total attendence numbers for different sessions BEFORE the actual start. Sessions that appeared to have higher demand could be moved to bigger rooms accordingly.

Like most conference apps, we also chose to put various bits of static info in the app. As I had to explain to different organizers, you can't just extend an existing site into a mobile app. Unlike a CMS like Drupal, each dynamic app functionality takes longer to develop, so where the content was likely to stay static, we built it into the app as static. As such, we elected to keep our about pages, organizer pages and sponsor lists as embedded content.

Conclusion:

From a technical perspective, building Mobile Apps with Android and iOS wasn't that easy. It's also not without additional time and cost. Many times a responsive, mobile design is enough since it allows users to have a reasonably good experience on whatever device they use.

From my personal builder and developer perspective, it wasn't quite as hard as I imagined it could have been either. Neither easy nor hard, this approach carried various challenges.

For iOS, we were fortunate to have a preexisting library that made developing an iOS onto of an existing Drupal Site: Drupal iOS SDK from Kyle Browning. This library significantly helped in creating our iOS app. Specifically, this library abstracted out several common features like logins, pulling node data, etc as well provided an add-on library for integrating flags.

Like a lot of US-based development, we started with iOS and then built the Android app after. There was no doubt though that we were going to build for both platforms. Unfortunately there wasn’t a preexisting library to use but the basics and structures in the iOS library helped clarify what we needed for the Android version.

In conclusion, mobile apps are the more recent and current tech wave. In some cases mobile apps are superfluous. But for Drupal-powered conference sites, a mobile app can be a good fit to improve the user experience and interaction before, during and after you event.

Tags: Drupal Conferenceconferencesmobile appsiOSAndroidDrupal PlanetPlanet DrupaldrupalDrupal Commerce Mark Koester @markwkoester Mark has worked on Drupal since the early days of D6. He is passionate about open source as well as entrepreneurship. When he isn't building, he enjoys traveling and speaking one of his many foreign languages. Chengdu, China
Categorieën:

Pagina's