Drupal aggregator

Subscribe to Drupal aggregator feed
drupal.org - aggregated feeds
Updated: 9 hours 57 min ago

Dries Buytaert: Want more features in Drupal 8? Help fix bugs!

Thu, 05/16/2013 - 12:30
Topic: Drupal

In Drupal core, we use issue thresholds to manage technical debt. Both critical (release-blocking) and major (non-release-blocking, high-impact issues) are considered. When we have more open issues than our thresholds, we do not commit new features.

Currently, we have 27 critical bugs, 41 critical tasks, 155 major bugs, and 149 major tasks. This is more than twice our current thresholds for critical issues, and about 50% more than our thresholds for major issues. We need your help to resolve these issues so that we can resume adding new features to Drupal 8. That would be a very exciting place to get to!

There are many ways to help, including not only programming but also updating these issues' summaries, testing the patches, and making sure the patches still apply. I encourage everyone to collaborate on major and critcal issues, and to consider making them a focus at the DrupalCon Portland sprints.

Propeople Blog: Annotations in Drupal 8

Thu, 05/16/2013 - 12:23

There have been a lot of mentioning that Drupal 8 is using Annotations. In this article I will dive in how Drupal uses them and how to leverage Annotations mechanism yourself.

In brief, annotations are blocks of comments that are parsed and used as a source of information about something. For example in Drupal 8, plugins system Annotations are used to describe plugins. They are alternatives to our TYPE_hook_info hooks and are now widely used.

For example:

<?php
/**
* Defines a default processor implementation.
*
* Creates lightweight records from feed items.
*
* @Plugin(
* id = "aggregator",
* title = @Translation("Default processor"),
* description = @Translation("Creates lightweight records from feed items.")
* )
*/
class DefaultProcessor extends PluginBase implements ProcessorInterface {
}
?>

How does this work technically?

For parsing annotations Drupal uses AnnotationReader class from Doctrine. This class can retrieve annotations from classes, class methods in the following way: <?php
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Reflection\StaticReflectionParser;

$object = new CustomClassWithAnnotations();
$annotation_name = 'Drupal\custom_module\Annotation\CustomAnnotation';

$reader = new AnnotationReader();

// Register the namespaces of classes that can be used for annotations.
$annotation_namespaces = array(
'Drupal\custom_module\Annotation' => DRUPAL_ROOT . '/modules/custom_module/lib',
);
AnnotationRegistry::registerAutoloadNamespaces($annotation_namespaces);

$reflection_class = new StaticReflectionClass($object);
$annotation = $reader->getClassAnnotation($reflection_class, $annotation_name);
?>

In the example above $annotation will be an object - instance of class that is registered as annotation. For example in case of:

<?php
/**
* @CustomAnnotation(
* property1 = "value1",
* property2 = “value2”,
* )
class CustomClassWithAnnotations() {
} ?>

AnnotationReader will check if it understands the CustomAnnotation class and instantiates it. In order the reader to understand this annotation, we should register it with AnnotationRegistry.

How do we define the CustomAnnotation class? A good idea would be to inherit it from – Drupal\Component\Annotation\Plugin. It will parse annotation to an array that you can access the "get()" method $definition = $annotation->get();

Defining a new type of annotation can be done in the following way:

<?php
namespace Drupal\custom_module\Annotation;
use Drupal\Component\Annotation\Plugin;
/**
* Defines an CustomAnnotation annotation type.
*
* @Annotation
*/
class CustomAnnotation extends Plugin {
}
?>

Of course you can skip creating a new type of annotation and use @Plugin instead.

In Drupal, the primary usage of annotations is in AnnotatedClassDiscovery, to discover plugins. But we can go further and apply reading annotations from class methods:

<?php
$reflection_method = new \ReflectionMethod('CustomClassWithAnnotations', $method_name);
$annotation = $this->reader->getMethodAnnotation($reflection_method, 'Drupal\custom_module\Annotation\CustomAnnotation');
?>

We can use this for example for validation of arguments or even unit testing our methods (providing a set of arguments and results to test against).

Hope this article made it a bit clearer about annotations. If you need some help on annotations we will be glad to assist you on Facebook or Twitter.

You may also share your thoughts/comments below.

For further reading:
Declarative development using annotations in PHP
Using annotations in PHP with doctrine annotation reader
Use Annotations for plugin discovery

Language English Tags: DrupalDevelopmentTutorialsCheck this option to include this post in Planet Drupal aggregator: planet

Acquia: Sign up for free Drupal for project managers - mini-course

Thu, 05/16/2013 - 12:09

Are you a project manager working for a company adopting Drupal? Are you new to managing Drupal projects? This course is the right one for you!

This course follows the life cycle of a Drupal project from start to finish and back again and is based on our full day Drupal for Project Manager’s course.

Lullabot: Mentorship Consulting: A Client Primer

Thu, 05/16/2013 - 11:00

Mentorship consulting is one of the many services that Lullabot provides, and is something we’re known for in the Drupal community. When we work with potential clients to describe what we can do for them, it can sometimes be very difficult to explain how a consulting relationship works. This is especially true if they have never participated in consulting engagements with us or another agency.

Wizzlern: About Twig in Drupal 8

Thu, 05/16/2013 - 10:23

Twig is Drupal's best theme engine! Tomorrow I will speak at the DrupalJam about 'Twig in Drupal 8'. I will explain the pros and cons of Twig for Drupal themers, show examples of new Twig templates, explain a summary of the Twig syntax and of course do a small demo of working with Twig templates. You'll find my slides here.

Tags:  theming Twig Render Array

Wunderkraut blog: Using Selenium IDE and Sideflow to log in to a Drupal 7 site

Thu, 05/16/2013 - 09:43

My team has been looking into the Firefox add-on Selenium IDE as a quick and simple way to create automated tests for our Drupal sites. Selenium IDE out of the box does not support conditionals, making it hard to account for unexpected behaviour. For instance, it's easy to make a test of the basic Drupal login functionality, but if the user is already logged in when running that test (a common scenario when working on a site), the test will fail. The solution to this is called Sideflow.

Sideflow was created by Darren DeRidder and currently extends Selenium IDE with these commands: goto/gotoLabel, label, gotoIf, while, endWhile, and push. I'm only going to use gotoIf and label in this example, but you can read about the others in the Sideflow GitHub repo and in the announcement on Darren's blog (where you can also find a lot of general Selenium IDE tips). Also see his blog posts Selenium IDE Sideflow Update 1 and Selenium IDE Sideflow Update 2. You might wonder why I don't just start the test with deleteAllVisibleCookies (a tip I got from 6 Ways to Make The Most of Selenium IDE), which in effect would log out the user before running the rest of the test. Well, it doesn't work with Drupal's session cookie since it's set to HttpOnly, meaning it can't be controlled by Javascript. A test that does work, however, is this: open | /userstoreElementPresent | //input[@id='edit-name'] | userIsLoggedOutgotoIf | ${userIsLoggedOut} == false | userIsLoggedInwaitForElementPresent | //input[@id='edit-name'] |type | //input[@id='edit-name'] | adminwaitForElementPresent | //input[@id='edit-pass'] |type | //input[@id='edit-pass'] | adminwaitForElementPresent | //input[@id='edit-submit'] |clickAndWait | //input[@id='edit-submit'] |label | userIsLoggedIn storeElementPresent looks for an element, in this case the username field shown when the user is logged out, and stores a Boolean value (true or false) in the variable userIsLoggedOut. If that element isn't present we can make a qualified guess that the user is already logged in, and just skip down to the label userIsLoggedIn, ending the test.  Green every time!

Rootwork.org: Drupal 8, aural interfaces and groundbreaking accessibility at Drupalcon Portland

Thu, 05/16/2013 - 09:30

I'm a millennial, but even I remember the experience of calling the telephone operator and getting a live human to look up the number of a business or place a collect call. We have the digital means to complete lots of tasks like that today, but that doesn't mean all of our methods are equally effective for everyone.

"Drupal 8 will be the most accessible version of Drupal yet," declare J. Renée Beach and Wim Leers in their Drupalcon Portland session description.

They're both part of the Spark team, an initiative to improve the authoring experience in Drupal for everyone.

Spark is more well known for things like in-place editing and a mobile friendly toolbar, which you can see at right. But from the beginning, improving the experience for everyone has been a big priority, and one of the most exciting developments is a new aural interface.

That's right, Drupal is getting a switchboard operator:

OK, so that doesn't look terribly exciting all on its own. But trust me, when you watch the videos of people interacting with Drupal 8 and having menus and selections read as they go, it's pretty cool.

When I spoke with J. Renée about Drupal 8 and the nature of working on accessibility, the passion for this work really shown through. I'm really looking forward to their session with Wim, "Drupal Speaks: Aural user interfaces, new Drupal 8 accessibility features," on Wednesday at 10:45 AM. Hope to see you there!

IB: What are we missing when we talk about accessibility right now?

JRB: I want developers to understand that accessibility is fundamental to user interface development. We tend to talk about accessibility like we talk about gender. Both have coded values. When we speak of being gendered, we are often talking about being non-male. Male is a kind of genderless base state. So is it with accessibility. When we speak of making something accessible, we tend to refer to making an interface for blind users or for users with physical capabilities that make keyboard and mouse use difficult, as examples. Visual is a kind of accessible base state.

We risk "othering" folks for whom accessibility is an issue because as developers, in general, non-visual accessibility has not been a primary concern. I know what is is like to be othered. In some ways, highlighting otherness can be an effective way to bring focus to a problem. Eventually though, we need to resolve those issues and close the loop on the otherness. We can be other and also be equal. Now is the time for front end developers to start thinking about accessibility as a multi-modal effort. We no longer have the excuse that the tools and technologies available to us do not support efficient workflows for non-visual UI development.

IB: Where is Drupal 8 going to do better?

JRB: Most importantly, we have more individual core contributors this cycle who truly believe in addressing accessibility issues. And they are all smart, wonderful people which makes working with them a pleasure!

For example, take this issue about requirement warnings during installation. For a sighted user, a warning during installation is immediately apparent. The missing requirement is made distinct with color contrast. For a blind user, they must traverse every cell in the table to discover a missing requirement. Would we ever impose such a burden on a sight user through the UI? No, not without grumbles in the issue queues at least. With more contributors invested in improving these types of non-visual details, we are polishing all the rough edges — the ones we see and the ones we don't.

IB: How important is context in aural interfaces?

JRB: Context is important to all interfaces. As front end developers we build templates that expose context in a predictable, consumable way. As a practice we have established and then refined patterns of visual expression over the past 30-plus years.

Metaphors grounded visual pointer displays on a virtual desktop. We talk of visual affordances in rounded, gradient-embellished, reflective buttons. Skeumorphic designs bring our understanding of the physical world to bear on pixels and bits.

Where are the metaphors in aural interface design? I know of none. To me, these interfaces are flat. The metal is bare underneath them.

Perhaps non-visual interfaces have one less level of abstraction to traverse. Maybe there's no need to translate language into symbol and then back into language. But that little bit of designer in me, that memory of a linguist I almost was, remembers being thunderstruck with insight reading Jackendoff's unfurling of metaphor after I had just so recently fallen smitten with the strict generative grammar of early Chomsky. Jackendoff gives us a way of understanding language that starts at basic physical dichotomies — up/down and near/far — and from there offers us a model of communication. He gives us pattern. (Early) Chomsky gave us metal. So much that we humans do starts with structure that softens with time to fit our curvy, winding nature.

I want to believe that the aural interfaces we have today still just the awkward first attempts to build an abstract audio interface pattern language. That non-visual interface design is still working through its structuralist phase. We are still learning how to pack context into denser forms through non-visual expressions.

IB: Will the Drupal 8 improvements have things to offer module developers?

JRB: In Drupal 8, we are building tools that manage a couple of the trickier components of accessibility in a browser. These are:

1. Outputting audio updates
2. Managing tabbing in constrained workflows

Module developers will be able to pass a string to a method called "announce" on the Drupal object and have that string read by a screen reader.

Another method on the Drupal object called "tabbingManager" will constrain tabbable elements on the page. A developer will select those elements, either through JavaScript methods or jQuery, and pass them to the tabbingManager. Tabbing is then constrained to those elements until the constraint is superseded or released. I know that must not be completely clear, but that's why we're presenting a session about aural user interfaces and how we can use these new tools to build them!

Top image: Public domain. Drupal images from the drupal.org issue queue and the session slides.

Join Rootwork on Twitter, Facebook and SlideShare.

Learn about Rootwork's services for nonprofits and social change.

Mediacurrent: 10 Tips to help prepare for DrupalCon Portland

Thu, 05/16/2013 - 08:50

With Drupalcon now only a few days away, preparations are beginning to ramp up (or maybe starting to die down, depending on how much prep work your company has already done). Drupalcon is *the* Drupal event of the year—and with more than 3,000 attendees and 50+ expert-led sessions, there’s a lot to think about before boarding that plane to Portland.

Microserve: Going live! A Drupal checklist

Thu, 05/16/2013 - 08:33

So you're launching a new website or replacing an old one and want to make sure everything goes smoothly? This guide will give you a run-down of everything you can check to avoid common pitfalls!

Site status

You should always start by checking the status report (http://example.com/admin/reports/status). This page shows you all of the basic requirements for your Drupal site to run correctly.

Any issues will be highlighted in red and typically have a link to a configuration page or the documentation to help you resolve the problem.

Scheduled tasks

Drupal 7 will run scheduled tasks (known as cron jobs) out of the box, but only when users are visiting your site.

This is great for small sites which don't need much housekeeping, but if your site is a bit bigger or if you don't have visitors 24/7, you should set up a cron job to run periodically.

You can also look at a module such as Ultimate cron which gives you fine grained control over when each scheduled task will run.

Web services

Many web services such as Mollom or Google analytics need a domain name specific API key to use.

If you use any of these services on your website, you should ensure that you've registered your real domain name with the service and you've updated Drupal with your new API key.

Broken links

It can be easy when copying and pasting to accidentally link directly to a file or image on a development site.

These links can often stop working or perhaps worse, may direct users away from your live site and onto the development site instead.

You can use a module such as Link checker to ensure this doesn't happen, and it is good practice to password protect your development website, so that users (or more likely Google!) cannot stumble accross it.

Site optimisation

The site performance page (http://example.com/admin/config/development/performance) will allow you to configure a number of options to help optimise your Drupal site. This includes page caching and optimising CSS and JavaScript files.

See our series on High Performance in Drupal for some expert tips - High performance in Drupal Part 1: Give your site a boost and High performance in Drupal Part 2: Lightning fast code.

Development modules

Development modules such as devel can often reduce your website's performance, so it's worth turning them off on your live site. You can still keep them running in your development environment if needed.

User accounts

Many of us are guilty of using a common or simple password to make life easier when building a website.

Once the site is live, it's worth taking the time to update any administrative accounts with secure passwords.

It is also worth removing any unnecessary development accounts and content. Just in case.

Error messages

Being able to see debug messages and errors are handy when creating a site, but may scare off users once the site is live.

Ensure that errors and warnings are hidden by visiting the Logging and errors config page.

Site information

The site information config page holds all of the most common site information, such as the website name and email address.

It's worth double checking that all of this information is correct. It could be quite embarrassing if your first newsletter arrives from dev@example.com.

 

Some of these pitfalls can be avoided from the get go, if you follow a few simple principles. Check out Rick Donohoe's blog article Drupal site building 101 for some handy hints and tips on this!

Flickr: Free Drupal 7 theme #drupal_12548

Thu, 05/16/2013 - 08:22

Free-Templates.lt posted a photo:

via Free-Templates.lt - Free Drupal, Wordpress, Joomla themes bit.ly/183wOLx FREE-TEMPLATES.LT

LevelTen Interactive: Setting Up the Rackspace Cloud to Send Drupal Emails with SendGrid

Thu, 05/16/2013 - 08:14

Moving Drupal website clients to cloud hosting has been great as they're able to get high performance, scalable capacity at a pretty reasonable rate. However, we have discovered when clients offer an email sign-up, the emails that are generated from the cloud-hosted Drupal website are often rejected as spam. For those clients who have chosen the Rackspace cloud, here is a step-by-step solution to the problem.... Read more

Flickr: ProjectPAAS different devices rendering

Thu, 05/16/2013 - 08:12

bertboerland posted a photo:

Flickr: Easy of implementation

Thu, 05/16/2013 - 08:10

bertboerland posted a photo:

Flickr: ProjectPAAS on facebook

Thu, 05/16/2013 - 08:02

bertboerland posted a photo:

SthlmConnection: Drupal, WordPress And All The Rest – How To Choose a Web Platform

Thu, 05/16/2013 - 07:19

This post discusses the differences between Drupal and WordPress, and also takes a quick look at a couple of other web frameworks. What are the benefits with each platform, and how do you know which one to choose?

Pronovix: Commerce Kickstart Wins Walkthrough.it Documentation Prize

Thu, 05/16/2013 - 06:13

We are pleased to announce that Commerce Kickstart has won the Walkthrough documentation prize. The prize, which was determined by votes from Walkthrough.it backers, will use the Commerce Kickstart Drupal distribution to showcase the capabilities of Walkthrough.it.

Commerce Kickstart is the quickest way to get up and running with Drupal Commerce. The distribution provides everything to create a fully-featured demo store out of the box, complete with theme, catalog, and custom back office interface.

Flickr: Drupal Yorkshire 14 May 2013 (113)

Thu, 05/16/2013 - 05:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Flickr: Drupal Yorkshire 14 May 2013 (112)

Thu, 05/16/2013 - 05:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Flickr: Drupal Yorkshire 14 May 2013 (110)

Thu, 05/16/2013 - 05:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Flickr: Drupal Yorkshire 14 May 2013 (111)

Thu, 05/16/2013 - 05:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Pages