Drupal Association News: Association members cultivate community with grants

Planet Drupal - 17 October 2016 - 10:04am

It isn't easy to build a strong community. Many event organizers work to bring people together for Drupal. Community Cultivation Grants are one tool to make the work a little easier. With a grant, you can strengthen the local community. You can help drive the adoption of Drupal.

Drupal Association members fund these grants. A few grant recipients have told us their stories. I'd like to share more about what has happened since the grants were awarded.

Andrey from DrupalCamp Moscow The DrupalCamp Moscow 2014 organizers have connected with the organizers of other camps — DrupalCamp Siberia (in Novosibirsk in 2015) and DrupalCamp Krasnodar (in September 2016). They've shared experiences to inspire the communities in these other Russian cities.

Andrey tells us, "In Moscow, we don't have any large companies which offer Drupal services. Our community organizes all the local events. After DrupalCamp Moscow 2014, we've held more events than ever before. 6 meetups, 22 small meetings, a D8 Release Party and one Drupal burgers event have happened. We've had Drupal specialists from other cities of Russia and the world come to visit. New participants are always welcome here and we are seeing more and more of them." Ricardo from Drupal Mexico City

Ricardo tells us, "We held another Drupal camp in Mexico City in 2015 with 250 attendees. In 2016, our dear fellows from Axai did the same in Guadalajara.

This year, we went off the island, just like Drupal 8 has, and we organized an even broader PHP event. It was amazing. The response was fantastic, we broke all our attendance records. We've grown the PHP Mexico community & PHP Way meetups and now have 1,000 members. Our attendees could become new Drupalists. But we expect to see new Drupalists come from the Symfony world.

We decided to have only one Drupal event in Mexico per year. In 2016, it was held in Guadalajara. If nobody else wants to organize an event at 2017, we'll probably do it again. If we organize the next Drupal event, it will probably happen together with a PHP event once again. Ultimately, community growth should be in concordance with demand growth. This hasn't happen here in CDMX, we are hopeful that it will."

Martha from Drupal Guadalajara

From Martha: "We attended DrupalCamp Costa Rica in September and continue being connected to the Drupal Latino Community. After Guadalajara camp, there is more local Drupal awareness. Our company has received training and quote requests since the camp."

Community Cultivation Grants do more than build connections in our community and grow our contributors. They also to help drive the adoption of Drupal.

Ivo from Drupal Roadshow Bulgaria

Ivo says, "Since the roadshow, there we've met our goal of running a Drupal Academy. We now run the biggest Drupal Course at Software University in Bulgaria. We have more than 1200 registered students. Our activities were featured in the Bulgarian National Television.
We are also proud of another result of the roadshow. One of the larger Drupal shops in Bulgaria opened their second office in a small town. We introduced Drupal there."

Tom from DrupalCamp Vietnam (2016)

Tom tells us, "I'm an entrepreneur and angel investor. Helping people become prepared for the digital enterprise is fulfilling to me. I want to spend more time coaching young developers with IT career decisions. To help get them learn how to use Drupal as a versatile data/content modeling tool. Which can act as a key platform to integrate with many other FOSS too. Including MERN stack, Hadoop, Spark, Docker, Openstack, etc.

Technology is always changing. What sticks is the experience you gain by contributing to an open-source community such as Drupal."

We're excited to see grant recipients building relationships in our community. You can connect with community and make more grants possible by joining the Drupal Association today.

Personal blog tags: Membershipcommunity cultivation grants
Categories: Drupal

Xeno Media: Xeno Media's Jim Birch presents at Bay Area Drupal Camp 2016

Planet Drupal - 17 October 2016 - 7:47am

Our Digital Strategist, Jim Birch, will be presenting on Holistic SEO and Drupal at BADCamp X, the 10th annual Bay Area Drupal Camp being held between October 20th - 23rd at the University of California in Berkeley.  This will be the second year in a row in which Jim will be participating in the event.

BADCamp is the largest regional conference dedicated to Drupal and open-source software with over 1600 attendees descending on the UC Berkeley campus for four days of presentations, trainings, summits, and sprints.

In 2015, Jim presented Optimizing Drupal 7 HTML Markup to a crowded room of Frontend developers and Site builders.

Watching @thejimbirch give a great talk on Optimizing Drupal Markup @BADCamp! pic.twitter.com/Yo8dwUljAw

— Wes Ruvalcaba (@wesruv) October 24, 2015

This year, Jim's focus is the modern state of Search Engine Optimization: How we at Xeno Media define best practices for technical SEO using Drupal and ideas on how to guide and empower clients to create the best content to achieve their goals.

This presentation will review:

  • What Holistic SEO is, and some examples.
  • The most common search engine ranking factors, and how to keep up to date.
  • An overview of Content strategy and how it can guide development.
  • An overview of technical SEO best practices in Drupal.

The presentation is:

In addition, Jim will be giving a lightning talk on Friday at the Frontend summit. Summits are more conversational in nature, and this event will focus on the best practices, and technologies used in Drupal development with presentations and panel discussions. 

Jim will be showcasing our soon-to-be-released Drupal contrib module Bootstrap Paragraphs.  The module is a suite of Paragraph bundles made with the Bootstrap framework's markup.

Categories: Drupal

Palantir: Addressing Accessibility for the Web

Planet Drupal - 17 October 2016 - 7:20am
Addressing Accessibility for the Web brandt Mon, 10/17/2016 - 09:20 Michellanne Li Oct 17, 2016

Making sure your website is accessible requires more than just fulfilling a checklist of best practices.

In this post we will cover...
  • How you should be thinking about accessibility

  • How to bake accessibility into your process

  • Some tips and tricks for creating accessible websites

We want to make your project a success.

Let's Chat.

The Americans with Disabilities Act was a landmark civil rights legislation that tore down barriers preventing individuals with disabilities from fully participating in society. This bill covered important aspects of life in the 1990s, such as public transportation and employment. A decade and a half later these things are still important, but technologies have emerged that raise new questions about how they can be made accessible for all users.

This year, I had the privilege of attending the 2016 Accessibility Summit, where presenters from organizations such as the W3 Consortium, Adobe, and WebAIM talked about ways in which we can make the web more accessible to users with disabilities such as low vision, blindness, deafness, and limited dexterity.

One of my biggest takeaways was that I had been thinking about accessibility all wrong. Initially, I saw accessibility guidelines as a checklist. Although lists are published by thought leaders such as Google (https://material.google.com/usability/accessibility.html#), it’s entirely possible for a website to adhere to accessibility criteria without effectively meeting the needs of disabled users.

While checklists are useful, they lack a human element. It helps to view accessibility as a holistic approach to design, development, and content that, at its core, relies on empathy and understanding of a wide range of user experiences.

Accessibility issues are ultimately user experience issues.

How do you bake accessibility into your process? Below are some ideas of how accessibility may become an inherent part of creating a website:

Create personas for disabled users to address accessibility. Some examples might be:

  • A person with low vision or blindness
  • A person who has recently suffered a stroke
  • A person who is positioned in the glare of the sun

The World Wide Web Consortium has created a diverse set of personas representing disabled users, which are available on their website (https://www.w3.org/WAI/intro/people-use-web/stories). There are also solutions provided for common problems these users might face on the web.

Create tickets based on disabled user personas. These tickets should have specific quantifiable success criteria, such as: “a person with vision impairment can fill out this form.” This is a great platform to demonstrate to clients how accessibility is being achieved.

From the onset, design with accessibility in mind. Designers should familiarize themselves with accessibility guidelines and incorporate them into their work starting with the earliest concepts.

For instance, whenever I’m working with text, I run potential colors for both the text and the background through a contrast checker (such as this one: http://webaim.org/resources/contrastchecker/). Contrast checkers confirm whether the combined text color and background color will be readable. Such measures preempt the need to rethink the design later in the process, thus saving time and avoiding the pitfalls of presenting a client with ideas that cannot be realized.

When designing the UI, aim for fewer steps to task completion. By decreasing the number of keystrokes, steps, and time required to complete tasks, we can make websites more accessible for everyone.

A task that is mildly annoying to complete for an abled user can be prohibitively time-consuming and frustrating for a disabled user. All users can benefit from the simplification of tasks, but disabled users will be especially impacted.

During development, take advantage of the wide range of auditing tools available to check whether your site adheres to accessibility guidelines. Some popular tools include:

Navigate and complete tasks on your website with the tools available to disabled users. This doesn’t replace user testing, but it can provide some useful insights. Here are some ideas:

  • Try using a screen reader, such as Chrome Vox. This helps you confirm whether your interactive elements are labeled clearly.
  • Change your iPhone’s accessibility settings and practice using your website with voiceover. Go into “Settings > General > Accessibility.”
  • Try using your keyboard only.

You can implement these techniques when demoing websites to clients to help them understand how different users access websites.

Recruit individuals with disabilities to participate in usability testing. This is the best way to confirm whether a website truly is accessible. Remember that accessibility guidelines are just the starting point. A site that checks off all the boxes may still have roadblocks for disabled users.

Disability rights lawyer, Lainey Feingold, provides on her website a list of nonprofits that offer usability testing by disabled individuals (http://www.lflegal.com/resources/#test).

Additionally, here are some tips and tricks for creating accessible websites. 
  • Use flyingfocus.js (https://github.com/NV/flying-focus) to add a sense of movement to the :focus state of interactive elements. This enhances the user experience of tabbing through a web page. Check out some examples here: https://github.com/NV/flying-focus/wiki/In-the-Wild
  • Sighted users who tab through a website also benefit from the addition of skip links. (However, non-sighted keyboard users do not use skip links because screen readers have ways of getting around repetitive content.) What’s a skip link? It is a link at the top of the page that the user can select to “jump” to the main content. This saves time that would otherwise be spent tabbing through the site header on every page. A skip link can be styled so that it is hidden until a user tabs over it. Adding a css transition so the hidden link is visible for a fraction of a second longer will ensure that the user doesn’t miss it.
  • Aria roles are useful, but employ them sparingly. Overuse of aria roles can actually diminish the accessibility of a website.
  • It’s dangerous to make assumptions about how users are interacting with and viewing your website. For instance, desktop users who zoom in on websites will wind up activating the mobile view. And some mobile users navigate with a keyboard.
  • Rather than “Read More” links, be specific: “Read more about ---.” This is important for users with screen readers who are unable to see the association between the “read more” link and the content it references. You can visually hide “---” so that only screen readers will detect it.
  • Blocks of text should be no more than 80 characters or glyphs wide (40 if CJK). 45-75 characters is considered ideal.
  • Avoid using screen reader detection. Visually impaired individuals do not want to feel like they are being treated differently or tracked.
  • Avoid using tabindex with positive values. Instead, structure your markup for logical and intuitive navigation.
  • Use tabindex(-1) to set focus on things that aren’t natively focusable.

Stay connected with the latest news on web strategy, design, and development.

Sign up for our newsletter.
Categories: Drupal

Amazee Labs: Project Managers matter, and other self-actualizing thoughts

Planet Drupal - 17 October 2016 - 6:59am
Project Managers matter, and other self-actualizing thoughts

I had a wild aha moment last week while I was away at my first PM conference. I work in web and I'm a project manager. I thought I “got it”. Except, I guess I didn’t.

It wasn’t until I was surrounded in a ballroom of my peers, hearing Brett Harned's Army of Awesome rallying cry, seeing the words blown up on a screen that I realized, Oh my god. I'm not a glorified secretary.

I may not be the one coding, designing, or deploying a product, but what I do matters. It makes a difference. I'm part of my team in a tangible way. And a there are others like me

Stephanie El-Hajj Mon, 10/17/2016 - 15:59

Similar to DrupalCon, the Digital PM Summit is a conference that travels around the US from city to city each year. This year it landed in San Antonio, a hop-skip and two-hour drive from my home in Austin, Texas.  

As a seasoned event manager, I tend to have a pretty agnostic relationship towards attending conferences. Speakers present their topics. Attendees politely paid attention, or didn’t. The draw of a glowing macbook is hard competition against topics which don't directly apply to me and the work I do.

But this time was different. For once, I not only understood the scheduled topics, I wanted to attend them. For once, I had trouble choosing. I was even excited to talk to strangers, not something that comes easy to me, because we already have something in common.

My world was rocked.

Over the course of three days, speakers and attendees shared tools, processes, tips, and horror stories of life in the PM trenches. It was quite cathartic and therapeutic to be surrounded by people who understand and empathize, because they live it, too.

Talking to other digital project managers this weekend was invaluable, and something I didn’t realize I was missing out on. Turns out, I wasn't the only one. While a handful of the attendees were newbies, like me, many others remember their first Digital PM Summit fondly. All these same warm-fuzzies I was feeling was part of the reason they come back.

Here’s a few of my biggest takeaways, many of which were reiterated by different people, in various situations, throughout the course of the event:

1. The struggles and challenges I face as a PM are normal. I'm not on actually fire, and nobody has died.

2. Early and honest communication helps solve and prevent problems.

3. Problems aren’t always external. Internal scope creep is real. 

4. Nobody's figured out how to virtually replicate an in-person whiteboard brainstorming session.

5. Project Managers should carve out time for themselves and often don’t. 

6. The importance of empathy, building relationships, and treating people like humans. 

Side note: If you haven't seen Derek's DrupalCon Dublin session on perfectionism or read Brené Brown's work on vulnerability and you work with people, do yourself a favor, and get caught up. 

As you can probably gather, DPM was quite a touchy-feely event, something that's not the most comfortable thing in the world for me. I think that twinge of discomfort helped me appreciate the honesty and open dialogue even more. For me, this event was professionally and personally beneficial and I've come home better prepared to work with my team, to engage with my clients, and to better appreciate and respect the work that I do. That we all do. 

If you're a PM, and you haven't heard this at all or lately, you are awesome. Your work matters. You're here because you're needed.

Categories: Drupal

Amazee Labs: Drupal Composer recipes

Planet Drupal - 17 October 2016 - 3:49am
Drupal Composer recipes

In this post we are going to share some Composer recipes we collected while working with Drupal projects created from the Drupal Composer template. Also, we will take a look on how to convert an existing Drupal project to a Composer project.

Alex Tkachev Mon, 10/17/2016 - 12:49

If you still don't use Composer for managing Drupal projects, you should start doing this right now! The Drupal Composer template will help you to set things up. It's really easy to setup a new project.

If you’re still not convinced, check out the benefits of the Drupal Composer workflow:

  • No need to store contrib code (and the core!) in your version control system.
  • A single package management tool for everything: Drupal core, contrib modules, JS libraries, your own shared modules, etc.
  • Patching of core and modules is easier than ever.
  • It's way simpler than git submodules.

(All recipes consider Drupal 8, but they should work for Drupal 7 as well)

Installing contrib modules
  • composer require drupal/<MODULE_NAME>:~8.0 to get the latest stable version (or latest dev, if there is no “stable release")
  • composer require drupal/<MODULE_NAME>:dev-<BRANCH_NAME> to get the latest dev version
  • composer require drupal/<MODULE_NAME>:dev-<BRANCH_NAME>#<COMMIT_HASH> to get the exact version
Updating Drupal core/modules
  • composer update to update everything
  • composer update --dry-run to check for updates
  • composer update drupal/<MODULE_NAME> to update a single module
Patching packages

The cweagans/composer-patches plugin (which comes with the Drupal Composer template) will take patches from the "extra" section of the composer.json file:

"extra": { "patches": { "<PACKAGE/NAME>": { "<PATCH DESCRIPTION>": "<PATH/TO/PATCH/OR/URL>", ... }, ... } }


"extra": { "patches": { "drupal/core": { "Fix language detection": "patches/2189267-24.patch" } } }

After a new patch is added run:

  • composer install to apply patch
  • composer update nothing to make the composer-patches plugin write necessary changes to the composer.lock file
Installing custom/forked modules from Github For the case when a module repository contains its own composer.json

Register the repository in the "repositories" section of the composer.json file:

"repositories": [ { "type": "vcs", "url": "https://github.com/<REPOSITORY/NAME>" }, ... ],

Use composer require drupal/<MODULE_NAME>:dev-<BRANCH_NAME>#<COMMIT_HASH> to install the module.

For the case when the composer.json file is missing from the module repository

You'll need to use a bit more verbose variant:

"repositories": [ { "type": "package", "package": { "name": "drupal/<MODULE_NAME>", "version": "dev-custom", "type": "drupal-module", "source": { "type": "git", "url": "git@github.com:<REPOSITORY/NAME>.git", "reference": "<BRANCH-NAME>" } } }, ... ],

Use composer require drupal/<MODULE_NAME>:dev-custom#<COMMIT_HASH> to install the module.

For the case when the destination path should be different than modules/contrib

In addition to the above recipes, use the composer/installers plugin:

"extra": { "installer-paths": { "web/modules/custom/<MODULE_NAME>": ["drupal/<MODULE_NAME>"], ... } } Adding a JS library

Most popular libraries can be added easily with composer as they exist on Packagist. The tricky part is that most Drupal modules require that libraries are saved under the "libraries" directory while Composer installs them to "vendor". The composer/installers plugin can override package paths, but only for packages that depend on it. So, you'll need to override the composer.json file of the library stating that it has the composer/installers dependency.

Let's take a look at an example:

"repositories": [ { "type": "package", "package": { "name": "enyo/dropzone", "version": "4.3", "type": "drupal-library", "source": { "url": "https://github.com/enyo/dropzone.git", "type": "git", "reference": "master" }, "dist": { "url": "https://github.com/enyo/dropzone/archive/v4.3.0.zip", "type": "zip" }, "require": { "composer/installers": "~1.0" } } }, ... ], ... "extra": { "installer-paths": { "web/libraries/{$name}" : ["type:drupal-library"], ... } }

After the above is added to the composer.json, run composer require enyo/dropzone:4.3 to download the library. Also, here we have used the exact version and added the "dist" section to make it possible for Composer to download a zip archive instead of cloning the Git repository.

Switch a dependency package to a forked version

Add the forked repository to the composer.json:

"repositories": [ { "type": "vcs", "url": "https://github.com/<REPOSITORY/NAME>" }, ... ],

Run composer require <PACKAGE/NAME>:dev-<BRANCH_NAME>#<COMMIT_HASH>

Update an existing Drupal 8 project to use Composer
  • Make a backup ;)
  • Delete everything that will be managed by Composer: Drupal's "core" folder, contrib modules, etc.
  • Delete all Drupal "root" files, such as index.php, update.php, README.txt... All of them.
  • Create "web" directory in the project root and move all remaining Drupal folders (sites, modules, themes, libraries, profiles, etc.) into it.
  • Copy the Drupal Composer template files to the project root.
  • Prepare a list of Drupal core and contrib module versions (and everything else that will be managed by Composer) that are used currently on the project. Then run composer require specifying every dependency with the exact version. You'll need to convert Drupal versions into Composer versions, here are some examples:
    • drupal/core:8.1.8 is obvious
    • drupal/admin_toolbar:8.1.15 refers to admin_toolbar 8.x-1.15
    • drupal/ctools:8.3.0-alpha26 refers to ctools 8.x-3.0-alpha26
    • drupal/config_installer:dev-8.x-1.x#a16cc9acf84dd12b9714def53be0ce280a5b0c1a refers to config_installer dev snapshot made from the a16cc9a commit of the 8.x-1.x branch
  • Manually update versions of Drupal core and contrib modules to "~8.0" in the "require" section of the composer.json file. That will make updates possible.
  • Run composer drupal-scaffold which will create the Drupal "root" files.
  • Make your webserver use "web" directory as the web root.
Categories: Drupal

Deeson: AI is a punk teenager and is angry at its parents

Planet Drupal - 17 October 2016 - 3:04am

This blog post covers 50% of what I’m going to be talking about at this year’s Museums Computer Group conference at the Wellcome Trust in London, held on the 19th of October. The follow-up post will go live on the 20th - you can sign up here to be notified.

There are three important things you need to understand about artificial intelligence:

  1. It exists now
  2. It’s more capable than you know.
  3. It will replace you (unless you redefine who you are).

I’ll examine each one - it’ll be interesting to see what you think.

It exists now

Artificial intelligence, as a concept, has been around for a long time. From Hephaestus building the “fighting machines of the gods” to Mary Shelley’s Frankenstein, humans have thought about and created stories around our desire to replace the mighty gods with ourselves for several thousand years.

We see it today with modern franchises like “The Terminator” and “The Matrix”, and less recently with “2001: A Space Odyssey” and “Do Androids Dream of Electric Sheep/Blade Runner”. AI is so popular and accessible as a concept in mainstream media that if you ask people what they think it is, they think they’ll be able to answer.

But here’s the rub - it’ll sound something like “Killer Robots in the Future!”. Rarely do you hear anyone mention the effect of AI on the stock market or the Amazon website. I find this lack of awareness about AI frustrating and frightening because AI exists now, it has existed for decades, and it impacts almost every aspect of our daily lives.

The birth of AI as a research area happened in 1956 at Dartmouth College in New Hampshire as a small but well-funded programme that hoped to create a truly intelligent “thinking machine” within a generation. They failed of course, as creating intelligence isn’t particularly easy. But they laid the foundations. With others following, the acceleration of our understanding and the number of practical uses for AI has increased. And like most technologies, the rate of improvement in AI can be plotted as an S curve.

Technologies tend to have a slow adoption rate early on as a result of the limited capabilities they offer. As the offer increases, so does the adoption rate. Unlike exponential growth, the S curve understands and plots the reduction of the technology’s popularity as we find its maximum potential, or as market forces push funding into new technologies which will ultimately replace it.

A better way to picture the impact of a specific technology on our lives is as a game of chess. At the start of the game, the choices you make are small and of little significance. You can recover from a mistake. But by the time you reach the middle of the board every decision you make will have large significance, and each creates a win or lose situation. Games of chess also follow the S curve.

By the time a technology reaches the lower midpoint of the curve it starts to have a major visible impact, with the velocity of that impact suddenly starting to increase. Artificial intelligence is now at that point. AI is not just here, it’s a punk teenager and pissed off at it’s parents.

It’s more capable than you know.

You interact with AI and one of its children, Machine Learning, every time you use any web-connected device. You do it every time you search, shop online, fill out a form, send a Tweet, or upvote a comment. It even happens when you buy petrol, turn on the tap, drive your car to work, or buy any newspaper. Every aspect of your life is measured, stored, and used at some point by an algorithm.

Everything you do while living your life is kept as data so that machines can later parse it and use it to identify patterns. The effect is huge.

Roughly 70% of the world’s financial trading is controlled directly by 80 computers that use machine learning to improve their own performance. They can recognise an opportunity and carry out a purchase or sale within 3 milliseconds. The speed at which they operate means that humans are not only incapable of being part of the process, but have been designed out of the system completely to reduce error.

AI is rapidly getting to the point where it is better at diagnosing medical conditions than teams of doctors. Every patient report, every update to a patient’s condition, and every case history is available as digital data to be parsed, analysed and scored in real time to diagnose conditions that require a breadth of knowledge no single person has. In one case from Japan, AI was used to solve (in 10 minutes) a cancer diagnosis that oncologists had failed to detect (the human doctors had spent months trying).

Statistically, computers are better drivers than people are. In the 1.4 million miles Google’s fleet of self driving cars have covered on public roads, “not one of the 17 small accidents they’ve been involved in was the fault of the AI”. There’s the Google car driving into a bus that happened recently, but deep analysis of the incident showed that the bus actually drove into the car. A study by Virginia Tech showed that Google’s autonomous systems are 2.5 times less likely to have a car crash than a human. Given some of the behaviour I’ve experienced on the roads, I think this is a pessimistic number. AI is also being used to fly planes, with pilots of the Boeing 777 on average spending “just seven minutes manually piloting their planes in a typical flight” (anonymous Boeing 777 pilot). The United States and British governments have had fully autonomous drones flying for well over a decade.

Computers are now writing articles, poems, and even screenplays. Netflix’s now famously complicated taxonomy may have been put in place by people, but it’s machines that use it to work out what the next hit TV show will be. Associated Press uses AI to deliver over 3000 reports per year, while Forbes’ earning reports are all machine generated. These aren’t lists of numbers - this is long-form copy. Many sports reports are now written using AI, and they are published instantly as soon as the game ends. Before the team has left the field, the articles are being read. A study by Christer Clerwall showed that when asked to tell the difference between machine or human-written stories, people couldn’t. I mean, can you tell which parts of this blog were written by a machine?

Computers are better at designing their own components than people are. In the 1990’s Dr Adrian Thompson of Sussex University wanted a test on what would happen if evolutionary theory was put to use by machines in building an electrical circuit. The circuit was simple - all it had to do was recognise a 1KHz tone and drop the output voltage to 0, or for a 10KHz tone an output of 5 volts. An algorithm iterated over 4000 times before finding the best possible circuit. The circuit was tested, and it worked perfectly. The surprising thing though was that nobody could explain how the circuit worked, or manage to produce a better one. This experiment has been repeated many times, with more and more complexity introduced, and each time the machines make parts for themselves better than people can.

Computers are creating art, helping to cure the sick, improving themselves, and taking care of complex or monotonous tasks. We let them drive us, shop for us, fly us, and treat us. We let them form opinions for us, and let them entertain us. Where do people fit in?

It will replace you (unless you redefine who you are)

A study in 2013 showed that 47% of jobs in the United States were at risk of being replaced by automated systems. And a lot has happened in 3 years.

While your interactions with AI can make your life easier and more pleasant, they are designed to achieve something more. Every time you do something that can be logged and compared, you are training the AI in human behaviour. We can’t stop living our lives, so how can we stop the machines taking over?

If you are coming to the Museum's Computer Group Conference on October the 19th, I’ll tell you!

Categories: Drupal

qed42.com: New Module - Referral Discount for Drupal Commerce

Planet Drupal - 17 October 2016 - 1:25am
New Module - Referral Discount for Drupal Commerce Body

One of the popular Growth hacking technique for e-commerce and SaaS businesses is Referrals, which is to leverage your user's network to get new users by offering incentives / discounts. On a recent e-commerce project we had the requirement to create a complete referral system but couldn't find a module that came close to fulfilling the requirements, hence we developed and contributed Commerce Referral Discount. This module allows us to provide a discount credit to an existing user for referring new users. Discounts can be configured for both the referring user and the new user who joins as part of the referral. Lets see a typical flow:

  • User A invites user B to signup on website using a unique invite URL (http://yoursite.com/invite/username).

  • User B visits the site using this URL, and is taken to the registration form to create a new account.

  • User B gets some discount amount (say $5) which he could use on his first purchase.


  • After user B makes his first purchase, user A gets a discount amount (say $10), which could be used in the next purchase.

  • Both discount amounts are configurable from the admin backend.

Module Configuration:

  • To configure the discount amounts browse to /admin/config/referral-discount


  • Configure referral discount on product purchase at Administration » Store settings » Promotions » Discounts:

    • Go to admin/commerce/discounts page.

    • Click on "Add discount" button.

    • Choose discount type : Order discount

    • Choose offer type : Referral Discount

    • Now click on Save discount.


  • Configure Invite/Referral Link block

    • Visibility settings: Show block for authenticated user.

Commerce Referral Discount module provide "Invite/Referral Link" block, which contains unique refer/invite link for authenticated users to share across their friends. 

The module also integrates with views:

  1. It provides a view type 'Commerce Referral Discount' which can be used to list down all the discounts and other data which it stores in the 'commerce_referral_discount' table in database.
  2. It also provides relationship to the user entity, so you can also include the data of Referrer user and Invited user.


    Nikhil Banait Mon, 10/17/2016 - 13:55
    Categories: Drupal

    Janez Urevc: Drupal 8.2.0 and composer wonderland

    Planet Drupal - 17 October 2016 - 1:22am
    Drupal 8.2.0 and composer wonderland

    Over the weekend I took some time to update this site to the latest and greatest Drupal. Update itself was pretty straightforward and it went without any problems (great work Drupal community!).

    More interesting part was something that I wanted to do for a while. Until now I was using old-school approach repo with all modules and other dependencies committed in it. Most of you probably already heard about the Composer. Thanks to Florian Weber (@webflo) and other contributors it is now fairly easy to manage your Drupal projects with it. There is a Composer template for Drupal projects available which will give you everything you need to get started. It took me just a good hour to fully convert my project (I am no Composer expert). I found this approach very nice and convenient and will be using it for all my future projects.

    As part of this I also worked on a pull request for Drupal docker project that makes docroot location configurable, which is a requirement for Composer driven projects.

    slashrsm Mon, 17.10.2016 - 10:22 Tags Drupal Docker Composer Enjoyed this post? There is more! Drupal dev environment on Docker janezurevc.name runs on Drupal 8! Call for Drupal 8 media ecosystem co-maintainers
    Categories: Drupal

    Vardot: DrupalCon Dublin 2016 - What Drupal means to us?

    Planet Drupal - 17 October 2016 - 1:09am
    Events Read time: 1 minute

    The DrupalCon in Dublin is over – and now it’s officially. We all had fun, enjoyed sessions, sprints, visited all the booths, collected prizes, and had a lot of great talks with drupalists from all over the globe. All the expectations we had before this event came true, and now it’s time to make some conclusions.

    But instead of writing a long recap, we at Vardot decided to remind you about the coolest moments of the conference in one short video. It's  better to see once than hear a hundred times – so enjoy!



    Did you find yourself in a video? If not, how would you describe Drupal with one word? Your opinion counts. What were the most exciting moments of the conference for you? Share your emotions in a comments section below and see you next year in Vienna!


    Tags:  DrupalCon Drupal Planet Title:  DrupalCon Dublin 2016 - What Drupal means to us?
    Categories: Drupal

    Drupalize.Me: Load Testing Our Site on Pantheon

    Planet Drupal - 17 October 2016 - 12:07am

    I did some load testing to try and answer the question; How did moving our site from Linode to Pantheon affect the performance-measured in response time-of our site for both members and non-members?

    Categories: Drupal

    Aurelien Navarre: From $conf to $config and $settings in Drupal 8

    Planet Drupal - 16 October 2016 - 11:37pm

    With Drupal 7 we were used to leverage $conf to set variable overrides. Unfortunately this was sub-optimal. The Configuration override system documentation page says it best:

    A big drawback of that system was that the overrides crept into actual configuration. When a configuration form that contained overridden values was saved, the conditional override got into the actual configuration storage.

    Using $conf on Drupal 7

    Let's say you wish to query the {variable} table for the site name.

    mysql> SELECT name,value FROM variable WHERE name = 'site_name'; +-----------+----------------------+ | name | value | +-----------+----------------------+ | site_name | s:12:"My site name"; | +-----------+----------------------+ 1 row in set (0.00 sec)

    You can quickly get the information you want and confirm this is indeed the value your site returns at /admin/config/system/site-information. Now, if you want to override the entry in code, you can put the below variable override in settings.php.

    // Override the site name. $conf['site_name'] = 'My new site name';

    When bootstrapping, Drupal would return the overridden site name with the original value left untouched in the database. Easy. Doing so also means the value provided in code wouldn't be modifiable from the Drupal administration interface any longer. Well, you could modify it, but it'd be overridden no matter what.

    In Drupal 8 the variable subsystem is gone and we now need to leverage either $config or $settings depending upon what we wish to achieve. Both are being set via Settings::Initialize - Let's explore each to understand the differences.

    When to use $config in Drupal 8?

    $config is brought to you by the Configuration Management system. To keep it really simple, think about variable overrides and call them configuration overrides instead. And as you can see below, there are indeed similarities:

    • You can globally override specific configuration values for the site.
    • Any values you provide in these variable overrides will not be viewable from the Drupal administration interface. (Don't think that makes sense? There's an issue for that.)

    But there are also notable differences. One I think worth mentioning is related to modules. In Drupal 7, it was easy to disable a module via $conf, by setting the below variable override.

    $conf['page_load_progress'] = 0;

    This was useful when - for instance - willing to have certain modules disabled in non-prod environments.

    In Drupal 8 though, overriding the list of installed modules in core.extension is not supported as module install or uninstall has not occurred and modules cannot be disabled anymore. There is a contrib module to try and bring back this functionality to Drupal 8, but be careful of unintended consequences on a production site.

    There are other particular configuration values that are risky to override, like field storage configuration which could lead to data loss. So, really, you have to make sure what is going to be overridden wouldn't have a negative impact on your site.

    In any case, the administration interface displays the values stored in configuration so that you can stage changes to other environments that don't have the overrides. If you do want to see the overrides, then there's the Drush --include-overridden argument to do just that.

    Let's say we wish to override the site name via settings.php.

    $config['system.site']['name'] = 'My new site name';

    To see the default and overridden values with Drush, just type the following.

    // Default value $ drush @site.env config-get system.site name 'system.site:name': 'My site name' // Overridden value $ drush @drucker.local config-get system.site name --include-overridden 'system.site:name': 'My new site name'

    Or you can use the Drupal API directly.

    // Default value >>> $site_name = \Drupal::config('system.site')->getOriginal('name', FALSE); => "My site name" // Overridden value >>> $site_name = \Drupal::config('system.site')->get('name', FALSE); => "My new site name" When to use $settings in Drupal 8?

    Let's try to understand the difference with $config. It's clearly explained in \Drupal\Core\Site\Settings

    Settings should be used over configuration for read-only, possibly low bootstrap configuration that is environment specific.

    settings.php tries to clarify that even more.

    $settings contains environment-specific configuration, such as the files directory and reverse proxy address, and temporary configuration, such as security overrides.

    In other words, this refers to settings that wouldn't exist in the Configuration Management system. Here's an example. When defining the private path, you don't have a choice but to define it via settings.php.

    $settings['file_private_path'] = '/mnt/private/files';

    Another example is API keys. You certainly don't want those or other sensitive information to be stored in the configuration and exported in YAML files and/or tracked under version control.

    Hopefully that clarifies the difference between $config and $settings. Let me know how you work with them and if I missed anything.

    Categories: Drupal

    Dynamic Tag Clouds

    New Drupal Modules - 16 October 2016 - 11:25pm

    This module provides a Tag Cloud based searching of content.

    Categories: Drupal

    Null auth

    New Drupal Modules - 16 October 2016 - 9:46pm
    Drupal Null Authentication Provider module

    This module is a null authentication provider. Enabling anonymous user access to Drupal 8 REST Resources, using an auto-login method.

    WARNING: This module does not control any flood and give auto-login for all requests. Use only in environments with controlled access.

    Configuration and usage instructions

    There is no specific configuration for this module, it enables automatically a null authentication method. You need to add a _null_auth query parameter to all your requests.

    Categories: Drupal

    Slushi cache

    New Drupal Modules - 16 October 2016 - 3:43pm

    A Drupal database cache backend where permanent is really only semi-permanent.

    If you're using a database based cache backend and seeing tables like {cache_render} and {cache_dynamic_page_cache} grow over time, then this might be the module for you.


    Download and enable the module.


    In your settings.php customise the lifetime like so:

    Categories: Drupal

    Quickbooks Webconnector

    New Drupal Modules - 16 October 2016 - 1:49pm

    Manage Quickbooks Webconnector endpoints / username / password combinations, generate QWC configuration files, appropriate WSDL file for the QBWC SOAP protocol, implement the QBWC SOAP server protocol, and provide Drupal hooks to send and receive Quickbooks XML (QBXML) queries and responses.

    Categories: Drupal

    A Dev From The Plains: Upgrading Drupal’s Viewport module to Drupal 8 (Part 3 – Final)

    Planet Drupal - 16 October 2016 - 2:44am

    Image taken from https://drupalize.me

    With parts one and two of the series covered, this 3rd (and final!) part will cover some other important aspects of Drupal development that I wanted to pay attention to while working on the Drupal 8 version of the viewport module.

    Essentially, the kind of aspects that are easy to forget (or ignore on purpose) when a developer comes up with a working version or something “good enough” to be released, and thinks there’s no need to write tests for the existing codebase (we’ve all done it at some point).

    This post will be a mix of links to documentation and resources that were either useful or new to me, and tips about some of the utilities and classes available when writing unit or functoinal tests.


    Since I wrote both functional tests and unit tests for the viewport module, this section is split in two parts, for the sake of clarity and structure.

    - Functional tests

    Before getting into the bits and blobs of functional test classes, I decided read a couple articles on the matter, just to see how much testing had changed in the last year(s) in Drupal 8. This article on the existing types of Drupal 8 tests was a good overview, as well as Acquia’s lesson on unit and functional tests.

    Other than that, there were also a few change notices I went through in order to understand what was being done with the testing framework and why. TL;DR: Drupal runs away from simpletest and moves to PHPUnit to modernise the test infrastructure. That started by adding the PHPUnit test framework to Drupal core. Also, new classes were added that leveraged PHPUnit instead of the existing Simpletest-based classes. Specifically, a new KernelTestBase was added, and also a BrowserTestBase class, replacing the well-known WebTestBase.

    I decided to base all my tests in the PHPUnit classes exclusively, knowing that Simpletest will just die at some point. One of the key requirements for this was to put all test classes in a different path: {module-folder}/tests/src/{test-type}/{test-classes}. Also, the @group annotation was still required, as with Simpletest, so that tests of specific groups or modules can be executed alone, without all the test suite running.

    The first thing I noticed when I started to write the first Functional test class, ViewportPermissionsTest, was that the getInfo() method was no longer needed, since it’s been removed in favor of PHPDoc, which means all the info there is retrieved from the documentation block of the test class.

    With PHPUnit introduced in Drupal 8, a lot of new features have been added to test classes through PHP Annotations. Without getting into much details, two of them that called my attention when trying to debug a test, were the @runTestsInSeparateProcesses and @preserveGlobalState  annotations. Most of the time the defaults will work for you, although there might be cases where you may want to change them. Note that running tests in separate processes is enabled by default, but some performance issues have been reported on this feature for PHPUnit.

    I also came across some issues about the lack of a configuration schema defined for my module, when trying to execute tests in the ViewportTagPrintedOnSelectedPagesTest class, which led me to find another change notice (yeah… too many!) about tests enforcing strict configuration schema adherence by default. The change notice explains how to avoid that (if really necessary), but given that’s not a good practice, you should just add a configuration schema to all your modules, if applicable.

    Some other scattered notes of things I noticed when writing functional tests:

    • drupalPostForm() $edit keys need to be the HTML name of the form field being tested, not the field name as defined in the Form API $form array. Same happens with drupalPost().
    • When working on a test class, $this->assertSession()->responseContains() should be used to check HTML contents returned on a page. The change notice about BrowserTestBase class, points to $this->assertSession()->pageTextContains(), but that one is useful only for actual contents displayed on a page, and not the complete HTML returned to the browser.
    - Unit Tests

    The main difference between unit tests and functional tests (speaking only of structure in the codebase), is that unit tests need to be placed under {module-name}/tests/src/Unit, and they need to extend the UnitTestCase class.

    Running PHPUnit tests just requires executing a simple command from the core directory of a Drupal project, specifying the testsuite or the group of tests to be executed, as shown below:

    php ../vendor/bin/phpunit –group=viewport

    php ../vendor/bin/phpunit –group=viewport –testsuite=unit

    As mentioned in the link above, there has to be a properly configured phpunit.xml file within the core folder. Also, note that Drupal.org’s testbot runs tests in a different way. As detailed in the link above, tests can be executed locally in the same way the bot does, to ensure that the setup will allow a given module to receive automated testing support once contributed to Drupal.org.

    PHPUnit matchers: In PHPUnit parlance, a matcher is ultimately an instance of an object that implements the PHPUnit_Framework_MockObject_Matcher_Invocation interface. In summary, it helps to define the result that would be expected of a method call in an object mock, depending on the arguments passed to the method and the number of times it’s been called. For example:

    $this->pathMatcher->expects($this->any()) ->method('getFrontPagePath') ->will($this->returnValue('/frontpage-path'));

    That’s telling the pathMatcher mock (don’t confuse with a PHPUnit matcher), to return the value “/frontpage-path” whenever the method getFrontPagePath() is called. However, this other snippet:

    $this->pathMatcher->expects($this->exactly(3)) ->method('getFrontPagePath') ->will($this->returnValue('/third-time'));

    It’s telling the mock to return the value “/third-time”, only when the getFrontPagePath() method is executed exactly 3 times.

    will(): As seen in the examples above, the will() method can be used to tell the object mock to return different values on consecutive calls, or to get the return value processed by a callback, or fetch it from a values map.

    These concepts are explained in more detail in the Chapter 9 of the PHPUnit manual.

    Coding Standards and Code Sniffer

    With the module fully working, and tests written for it, the final stage was to run some checks on the coding standards, and ensure everything is according to Drupal style guides. Code Sniffer makes this incredibly easy, and there’s an entire section dedicated to it in the Site Building Guide at Drupal.org, which details how to install it and run it from the command line.

    Finally, and even though I didn’t bother changing the README.txt contents, I also noticed the existence of a README Template file available in the online documentation, handy when contributing new modules. With all the codebase tidied up and proper tests in place, the module was finally good to go.

    That’s it! This ends the series of dev diaries about porting the Viewport module to D8. I hope you enjoyed it! There might be a similar blog post about the port process of the User Homepage module, so stay tuned if you’re interested in it.

    Links and (re)sources

    As usual, I’ll leave a list of the articles and other resources I read while working on the module upgrade.

    • Which D8 test is right for me?: link.
    • Acquia’s lesson on Unit and Functional tests: link.
    • Simpletest Class, File and Namespace structure (D8): link (note Simpletest wasn’t used in the end in the module port).
    • Converting D7 SimpleTests to D8: link.
    • Configuration Schema and Metadata: link.
    • Drupal SimpleTest coding standards: link
    • PHPUnit in Drupal 8: link.
    • Agile Unit Testing: link.
    • Test Doubles in PHPUnit: link.
    • Drupal coding standards: link.
    • README Template file: link.
    Change Records and topic discussions
    Categories: Drupal

    Thumbor Image Formatter

    New Drupal Modules - 16 October 2016 - 12:09am
    Categories: Drupal

    Commerce Jivosite

    New Drupal Modules - 15 October 2016 - 12:03pm

    Module provides integration with online chat service Jivosite's javascript API.
    It exposes basic customer information to your agent's app:

    • User's name (for logged in customers)
    • Cart order total amount
    • Cart order ID and admin area order edit link

    You can expose more info by implementing specific -alter hook in your custom module.

    You should have Jivosite script already added to you site for this module to work properly.

    Categories: Drupal


    New Drupal Modules - 15 October 2016 - 6:18am

    The GreatSchools API is a REST-based web service.

    You need this module if you need simple and "Drupal way" access to GreatSchools.

    Right now module allows you to do requests for these endopoints:

    Categories: Drupal


    New Drupal Modules - 15 October 2016 - 5:36am

    Classify will provide the ability to add classes (and other attributes) on any entity type.

    Allow a user configurable field to allow adding custom classes/attributes to an entity.
    Allow a predefined set of classes/attributes to be provided by a module/theme, allowing a user to select a class/attribute that already has 'functionality' attached to it.
    Each type of attribute (class, id, title, data-x, etc.) should be setup via a Plugin.

    Categories: Drupal


    Subscribe to As If Productions aggregator - Drupal