Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 9 hours 2 min ago

ADCI Solutions: Cloud hosting platforms. Part one: Pantheon

Tue, 10/31/2017 - 06:52

The story of your life: you are searching for a hosting because you need to share code between teammates and show an intermediate result to a client. You don’t need too much: an SSH access, Git, and Drush. You also would like to have a simple and convenient administration panel and have isolated environments and technical domains.

 

We know what hostings do have all these features. Let's talk about Pantheon that allows you to start a new Drupal 7 or Drupal 8 project in a few clicks.

 

Observe Pantheon

 

Mediacurrent: 7 Ways to Evaluate the Security and Stability of Drupal Contrib Modules

Mon, 10/30/2017 - 19:59

Keeping up with Drupal security updates is key to protecting your site, but assessing contrib module security before implementation is just as important. In a new guest post on the Pantheon blog, Mediacurrent Senior Drupal Developers David Younker and Joshua Boltz share a practical guide for sizing up the security of contrib modules.

Try this 7-Step Security Inspection 

To ensure a safe and solid foundation for your Drupal site, consider this 7-point assessment:

1. Has the module maintainer opted in to the security coverage?

Aten Design Group: The Importance of an Accessible Website - Part 3: Make Your Drupal 8 Site More Accessible

Mon, 10/30/2017 - 17:09

Accessibility should be part of the criteria for picking a CMS. Fortunately, many CMSs out there are getting that right. Building on the information from Part 1 and Part 2 of this series, I’m going to focus on leveraging Drupal 8’s accessibility features to enhance any user’s experience.

Drupal 8 Core

Drupal 8 makes it much easier to add accessibility features than previous versions. Some of the most significant improvements for accessibility within Drupal 8 core are:

  • Core code uses semantic HTML5 elements and the addition of aria landmarks, live regions, roles, and properties to improve the experience of screen readers.
  • Creating aural alerts for users who use audio features to navigate and understand a website are easy to implement using Drupal.announce().
  • Users have more control navigating through content with a keyboard using the new Tabbing Manager.
  • Hidden, invisible or on-focus options for all labels have been included so screen readers can give more context to content – without impacting design decisions for traditional screens.
  • Fieldsets have been added for radios and checkboxes in the Form API.
  • Alt text is now required for all image fields by default.
  • The default Bartik Theme is now underlining links so that it is much easier for people to identify links on the page.
  • D8 now includes an optional module to include form errors inline to easily associate errors with inputs when filling in a web form.
Theming

Out of the box, Drupal core is a great starting point for creating an accessible website. Usability issues tend to arise when designers and developers begin the theming process. In order to achieve a desired design or function, they inadvertently remove or alter a lot of Drupal’s accessible defaults. With knowledge gained from the previous posts and the following tips, you will be on your way to theming a more accessible site for everyone!

Links

Make sure pseudo :focus and :active styles are always included for users navigating by keyboard. This helps the user visually understand where they currently are on a page. This can be the default browser styling or something more brand specific.

You may include “read more” links on teasers, but make sure there is a visually hidden field to include what the user will be “reading more" about for aural users.

Display None vs Visually Hidden

Drupal 8 core now has this option for labels when creating content types and forms, but it also includes simple class names to hide content properly. A great example of this usage is fixing a “read more” link to something more descriptive for screen readers.

<a href="{{url}}">{{'Read more'|t}} <span class="visually-hidden"> {{'about'|t}} {{label}}</span></a> Anchor and Skip Links

Providing a way to skip links and navigation on a page can improve the usability of a keyboard or aural user on your site. This is a great addition to your site and easy to implement. As mentioned in the previous post, screen readers have the ability to skip and search your site by sections, headings, links, etc. Adding another way to skip various types of content gives the user an easier way of flowing through and skipping heavy or repetitive information on a page. Just remember that this should be visibly hidden and not display: none;!

Forms

Always include a button for users to submit their form information. Exposed forms within Drupal have the option for an “auto submit” setting, which automatically submits the form once an element is interacted with or changed. Having one action which invokes two outcomes can cause major confusion for users navigating with assistive technologies.

For Example: A user chooses an item within a select dropdown, and the form submits this change which modifies the content on the page. All of this happens just by selecting an item within a dropdown. Ideally, the user should be able to choose the item in the dropdown, and then press submit to search. Each item should only have one action.

Be careful that you are not reducing the accessibility of forms when using hook_form_alter and other techniques to modify forms. Following the basic form guidelines while implementing forms through this technique will ensure that your forms work well for everyone.

Final Thoughts

We have seen great improvements in Drupal’s core code over the past few years to accommodate everyone. Drupal 8 has a lot of accessibility features built in and as developers we need to take advantage of those features or at the very least, not remove them.

Mediacurrent: Top 4 Takeaways from Acquia Engage

Mon, 10/30/2017 - 16:47

This October, Mediacurrent was excited to participate in our 4th Acquia Engage conference in Boston. As returning sponsors we enjoyed connecting with friends, partners, customers and potential customers, all set to a backdrop of Boston Harbor. The sessions were interesting and the receptions boasted delicious local fare (hello lobster rolls!), but the real highlight was to listen in on the strategy behind Acquia’s latest product announcements.

If you were unable to attend, never fear because we have you covered with the biggest topics from this year’s event.

Drop Guard: International PHP & JavaScript Conference - these guys sec you up!

Mon, 10/30/2017 - 13:30
International PHP & JavaScript Conference - these guys sec you up!

Our CEO Manuel spoke at the IPC 2017 in Munich about DevSecOps automation. We took a look around and picked the two other security related sessions which struck our eyes.

 

Dip Your Toes in the Sea of Security - by James Titcumb

Drupal Planet Events Security Business

Jacob Rockowitz: Organizing and Presenting Webform Training Materials

Mon, 10/30/2017 - 09:49

Now that the post-DrupalCon Vienna events are in full swing and next year's pre-DrupalCon Nashville events are in the works, I’ve started organizing and creating next year’s Webform related presentations. I find presenting at DrupalCamps challenging and rewarding. The challenge is getting up in front of a large group of developers and talking about my work, but the reward is I get to meet people who use my work to build awesome forms.

Attending Drupal Camps & Events

In the past, I’ve managed to attend a bunch of events including DrupalCamp NJ, NYCCamp, DrupalCon Baltimore, Design4Drupal, and Drupal GovCon. My last camp of the year is going to be DrupalCamp Atlanta on November 2-4, 2017. I decided to go to DrupalCamp Atlanta because they are offering me the opportunity to do my first training session called Learn how to build awesome webforms and a keynote panel discussion. Yes, I am uncomfortable with public speaking, however I’ve committed myself to doing it for longer and in front of more people; this conference is pushing me to up my game. The hope is that it will prove to be a good thing for me, and hopefully will, in turn, be a good thing for others too.

Overcoming Challenges

One technique I’ve learned to overcome my weaknesses is to leverage my...Read More

Roy Scholten: UX notes week 44

Mon, 10/30/2017 - 09:21
30 Oct 2017 UX notes week 44

A selection of Drupal design topics and issues that are moving or should be :)

Small big win: status report pattern reuse in the migrate UI

A nice success from last week was closing a critical issue for Migrate UI. Particularly pleased that we were able to apply a new “summary” user interface element we recently introduced on the status report page.

Big one: redesign the administrative UI

There was a big interest in this over several meetings and workshops at Drupalcon Vienna and after. Seven theme hasn’t evolved much over the last years and it shows.

The right issues are not yet in place for this but I see and hear multiple people thinking about this. There’s multiple parts to this, of course:

  1. A visual update. What would the next version of this style guide look like?
  2. Improve the information architecture. Lots of solid thinking around this already.
  3. Introduce new interaction patterns. We still mostly rely on tables, select lists and other basic form elements. Experiments with JavaScript frameworks should help here but we should design these starting from user needs.
  4. Modernize the underlying theme architecture.
  5. Update and extend the user interface standards documentation.
Drupal core could use another usability test

The core feature set has grown considerably over the last couple of 8.x releases. On the one hand it would be smart if we found a way to do more smaller tests more often. On the other hand, since it’s been more than 2 years since the last big usability test we could do with one of those as well. Lets figure out what we can do. Check in here if you’re interested in helping with this.

Something to look forward to: Layout builder

The layouts-in-core team has been steadily working towards this. Looks like we are in great shape and on track to really honestly add a visual layout builder to core. There’s a patch going through the last stages of review and refine in https://www.drupal.org/node/2905922. One cool smart detail is that this will also introduce a dynamic way to dynamically generate icons for different types of layouts. Very nice indeed.

Permissions UI

Core and contrib modules often come with their own (set of) permissions. It’s how you can configure which roles get access to do what. This permissions UI is currently an ever growing sea of checkboxes. This does not scale, for user nor machine. The current model of a grid lists all available permissions in rows and all roles in columns needs a thorough rethink. Lets figure out a plan for how to do that.

Also,

& some more pointers to where you can go to find out what’s going on.

Enjoy your week!

Tags drupalplanet

Agiledrop.com Blog: AGILEDROP: We are not here to replace your team

Mon, 10/30/2017 - 08:26
The history and future There is this digital agency which has specialized itself in Drupal a couple of years ago. Let’s call it Gr8 Solutions. And the business is very good, they signed some fancy contracts with some of the biggest companies in the country over the years and thus built themselves a reputation for being professional and creative. And in the process of acquiring new clients and new projects they were steadily growing. This also resulted in hiring a few new developers, a designer, and a salesperson. Fast forward to very near future, nothing memorable happened in the meantime.… READ MORE

qed42.com: Securing Cookie for 3rd Party Identity Management in Drupal

Mon, 10/30/2017 - 08:15
Securing Cookie for 3rd Party Identity Management in Drupal Body

We are in an era where we see a lots of third party integrations being done in projects. In Drupal based projects, cookie management is done via Drupal itself to maintain session, whether it be a pure Drupal project or decoupled Drupal project,.

But what when we have a scenario where user’s information is being managed by a third party service and no user information is being saved on Drupal? And when the authentication is done via some other third party services? How can we manage cookie in this case to run our site session and also keep it secure?

One is way is to set and maintain cookie on our own. In this case, our user’s will be anonymous to Drupal. So, we keep session running based on cookies! The user information will be stored in cookie itself, which then can be validated when a request is made to Drupal.

We have a php function to set cookie called setCookie() , which we can use to create and destroy cookie. So, the flow will be that a user login request which is made to website is verified via a third party service and then we call setCookie function which sets the cookie containing user information. But, securing the cookie is must, so how do we do that?

For this, let’s refer to Bakery module to see how it does it. It contains functions for encrypting cookie, setting it and validating it.

To achieve this in Drupal 8, we will write a helper class let’s say “UserCookie.php” and place it in ‘{modulename}/src/Helper/’. Our cookie helper class will contain static methods for setting cookie and validating cookie. Static methods so that we will be able to call them from anywhere.

We will have to encrypt cookie before setting it so we will use openssl_encrypt() php function in following manner:

/** * Encrypts given cookie data. * * @param string $cookieData * Serialized Cookie data for encryption. * * @return string * Encrypted cookie. */ private static function encryptCookie($cookieData) { // Create a key using a string data. $key = openssl_digest(Settings::get('SOME_COOKIE_KEY'), 'sha256'); // Create an initialization vector to be used for encryption. $iv = openssl_random_pseudo_bytes(16); // Encrypt cookie data along with initialization vector so that initialization // vector can be used for decryption of this cookie. $encryptedCookie = openssl_encrypt($iv . $cookieData, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv); // Add a signature to cookie. $signature = hash_hmac('sha256', $encryptedCookie, $key); // Encode signature and cookie. return base64_encode($signature . $encryptedCookie); }
  1. String parameter in openssl_digest can be replaced with any string you feel like that can be used as key. You can keep simple keyword too.
  2. Key used should be same while decryption of data.
  3. Same initialization vector will be needed while decrypting the data, so to retrieve it back we append this along with cookie data string.
  4. We also add a signature which is generate used the same key used above. We will verify this key while validating cookie.
  5. Finally, we encode both signature and encrypted cookie data together.

For setting cookie:
 

/** * Set cookie using user data. * * @param string $name * Name of cookie to store. * @param mixed $data * Data to store in cookie. */ public static function setCookie($name, $data) { $data = (is_array($data)) ? json_encode($data) : $data; $data = self::encrypt($data); setcookie($name, $cookieData,Settings::get('SOME_DEFAULT_COOKIE_EXPIRE_TIME'), '/'); }

Note: You can keep 'SOME_COOKIE_KEY' and 'SOME_DEFAULT_COOKIE_EXPIRE_TIME' in your settings.php. Settings::get() will fetch that for you.
Tip: You can also append and save expiration time of cookie in encrypted data itself so that you can also verify that at time of decryption. This will stop anyone from extending the session by setting cookie timing manually.

Congrats! We have successfully encrypted the user data and set it into a cookie.

Now let’s see how we can decrypt and validate the same cookie.

To decrypt cookie:

/** * Decrypts the given cookie data. * * @param string $cookieData * Encrypted cookie data. * * @return bool|mixed * False if retrieved signature doesn't matches * or data. */ public static function decryptCookie($cookieData) { // Create a key using a string data used while encryption. $key = openssl_digest(Settings::get('SOME_COOKIE_KEY'), 'sha256'); // Reverse base64 encryption of $cookieData. $cookieData = base64_decode($cookieData); // Extract signature from cookie data. $signature = substr($cookieData, 0, 64); // Extract data without signature. $encryptedData = substr($cookieData, 64); // Signature should match for verification of data. if ($signature !== hash_hmac('sha256', $encryptedData, $key)) { return FALSE; } // Extract initialization vector from data appended while encryption. $iv = substr($string, 64, 16); // Extract main encrypted string data which contains profile details. $encrypted = substr($string, 80); // Decrypt the data using key and // initialization vector extracted above. return openssl_decrypt($encrypted, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv); }
  1. We generate the same key using same string parameter given while encryption.
  2. Then we reverse base64 encoding as we need extract signature to verify it.
  3. We generate same signature again as we have used the same key which was used to creating signature while encryption. If doesn’t signatures doesn’t matches, validation fails!
  4. Else, we extract initialization vector from the encrypted data and use to decrypt the data return to be utilized.
/** * Validates cookie. * * @param string $cookie * Name of cookie. * * @return boolean * True or False based on cookie validation. */ public static function validateCookie($cookie) { if (self::decryptCookie($cookieData)) { return TRUE; } return FALSE; }

We can verify cookie on requests made to website to maintain our session. You can implement function for expiring cookie for simulating user logout. We can also use decrypted user data out of cookie for serving user related pages.

navneet.singh Mon, 10/30/2017 - 13:45

Matt Glaman: Using JSON API to query your Search API indexes

Sun, 10/29/2017 - 03:18
Using JSON API to query your Search API indexes mglaman Sat, 10/28/2017 - 22:18 The JSON API module is becoming wildly popular for in Drupal 8 as an out of the box way to provide an API server. Why? Because it implements the {json:api} specification. It’s still a RESTful interface, but the specification just helps bring an open standard for how data should be represented and requests should be constructed. The JSON API module exposes collection routes, which allows retrieving multiple resources in a single request.

Hook 42: Hook 42's BADCamp 2017 Takeaways

Fri, 10/27/2017 - 19:43

This year at BADCamp we had the opportunity to share in thought leadership by leading a training, participating in the DevOps Summit, and presenting 5 sessions with topics ranging from accessibility, git, project management, A/B testing, and contributing to the Drupal issue queue.

Continuing in the spirit of thought leadership, we also want to share with the whole Drupal community our takeaways, thoughts, and excitement about the new ideas and technologies we learned at BADCamp.

Lullabot: Effective Communication, Part 2: Crossing the Streams

Fri, 10/27/2017 - 18:20

The first article in this series helped us dismantle the various forms of communication, isolate common pitfalls, and set realistic expectations for the team. Now we'll dig a little deeper and explore effective communication techniques to help stakeholders, managers, and the development and design team work together in blissful symbiosis.

Makers vs Managers

First, we need to agree that all of these groups exist in different realms of the project.  What I mean by this is that each group is involved to a different degree and thus approaches the project with a unique mindset. One of my favorite articles outlining this concept is Paul Graham's 2009 post entitled "Maker's Schedule, Manager's Schedule."

Paul outlines the pitfalls of interrupting a "maker's" schedule with meetings. Managers run on a different style of schedule where meetings and context switching are a regular part of their workday. Makers, such as developers, need large blocks of uninterrupted focus to solve logic problems or hunt down a bug in the system. Remembering, preparing for, and attending meetings pulls the developer out of their "zone." And, as any developer will tell you, getting into that zone is much more difficult than being pulled out of it. This comic beautifully outlines the reason why you should never interrupt a programmer.

Minimize the Meetings

First, I'd like to talk to the meeting schedulers.  As we just outlined, meetings, or as most developers refer to them, "productivity crushing time sinks," are budgetary black holes when it comes to development. A one-hour meeting with a developer could cost two or more hours in productivity when you consider scheduling, prep and loss of focus. Lullabot Senior Developer, Juampy, wrote a great article on reforming this process. So when are meetings OK? Before scheduling one, ask yourself these questions:

  1. Could the information be exchanged via email?
  2. Could this information be rolled into a different, more encompassing meeting?
  3. Do we need to create a deliverable item?
  4. Will all invitees be involved?

I see a meeting being a valuable use of time when multiple people are brainstorming an idea and a deliverable needs to be produced as a result. The keystone of the decision being the interactivity of people. In the scope of a project, a meeting where the majority of invitees are present just to listen is a waste of time. Summarize the information in an email or a document and send it to people to read on their own. If the document is well constructed, follow up meetings and Q&A can be avoided completely and you just saved a boatload of time.

If you have decided that a meeting is necessary, consider who is critical to be involved in the meeting and who could stand to simply receive a summary of the decisions made. Inviting people to a meeting "just in case" is just another time sink. Furthermore, when you involve more people in a conversation, the lines of communication increase factorially, which leads to diluted discussions. Information is more easily processed and decisions made more quickly when there are fewer communication channels.

undefined

Keeping the meetings to a minimum removes the focus-busting barriers from your production team's workday, but you still need to be in the loop about the project. I've found that most meetings can be easily replaced with email, progress reports, or other project management tools. The benefit to the developers is that they can incorporate these tasks into their schedules in the most effective manner for them. For many stakeholders, however, meetings are how they stay connected to the project. If the meetings go away, other communication methods may fall in to replace them. That's not a bad thing, as long as expectations for how they should be used are set in advance.

Meeting Alternatives

How you structure these ground rules depends on the size and comfort level of both the development team and the stakeholders. A good project manager will sit in between to ensure the proper channels are used and are not being abused. At Lullabot, we often have the entire development team in the same Slack channel as the clients and set up a distribution mailing list for external stakeholders.

Before we get the project up to cruising altitude, we go over the safety speech with the client on how to use these tools effectively. For example, please don't fire off an email for every idea, bug, or individual task that comes to mind. This also goes for Slack pings. Consolidate your thoughts and send them out in a single request. If you truly want to be ignored and miss your deadline, ping the developer every time you send them an email to make sure they got it. Believe it or not, this has happened. Instead, work with the project manager and follow the communication guidelines outlined in the project charter or kickoff meeting. If all else fails, funnel your requests through the project manager and allow them to parse the necessary actions and assign them to the team. We'll discuss more on handling email effectively in the next article.

As a project manager, your place in the communication landscape could be lounging comfortably at the top of the hill enjoying the view, or you might be down in the weeds playing in the dirt. Teams will play nicely together in some projects and could be completely at odds in another. Your job is to keep the information flowing and the project on track.

Set the Ground Rules Early

When kicking off a project, the project manager should get stakeholders, developers, and designers together to discuss the expected frequency of communication and the proper channels to use for certain communications. For example, do you want your developers emailing the clients directly whenever they have a question? Or is it OK for stakeholders to ping developers on Slack every time they find what they consider to be a bug? Defining these ground rules in the project charter or at least in a formal kickoff meeting ensures that everyone is aware of the expectations and the channels are set to make the project run smoothly. It is very easy for clients to feel ignored or developers to feel overwhelmed if neither knows the right method or frequency to address their concerns.

Keep Your Focus  

Check in periodically with both stakeholders and the production team. Ensure the communication channels originally outlined are holding up and important information is not falling through the cracks. Make adjustments if needed, like increasing daily syncs or eliminating useless notifications. It’s easier to begin with fewer items in the communication landscape and add more as needed than it is to try and remove them later, so start lean.

Don't Overcomplicate the System

If you have some excellent communicators on your production team and the client is open to working with them, cautiously step out of the way and let the stakeholders and your team communicate directly. Given this responsibility, you might be surprised at the leaders you have hidden behind the screens. As a project manager, sometimes you can simplify the process by removing yourself!

"Don't add process for the sake of process. The fewer cogs in the machine, the simpler it is to maintain." -  Jerad Bitner, Lullabot Technical Project Manager

For more resources about effectively managing an agile system, check out Jerad’s article, "Lessons Learned in Scaling Agile."

Block Your Calendar

Lastly, here's a little trick for the production team I used when I worked in a meeting-heavy office environment. Coworkers had access to each others' calendars and could thus schedule meetings based on the attendees' availability, so I reduced my availability. I put two giant blocks of busy time over Tuesday and Thursday and made those my heads-down days.

undefined

This technique funneled most of my meetings into Wednesdays. I saved the smaller tasks that didn't require as much focused brain power to fill in the gaps in between meetings and hunkered down to attack the bigger tasks on those heads-down days. It was a huge productivity boost. Sometimes you need to control the communication flow however you can to get the work done.

We've covered a number of ways that the production team can work effectively with the stakeholders, and also how project managers can help facilitate that. Setting the ground rules early and avoiding unnecessary meetings go a long way to boosting productivity without sacrificing stability. The elephant in the room that we've been tip-toeing around is email. It is by far the most pervasive and invasive form of communication and deserves its own article's worth of attention.  Stay tuned for the next installment, where we'll discuss best practices as well as tips and tricks for dealing with a deluge of email.

In the meantime, if you have any suggestions of your own, I'd love to hear about them! How do you handle complex communication systems?

OSTraining: Adding a MailChimp Newsletter to Your Drupal Site

Fri, 10/27/2017 - 15:50

Finding easy to use modules for Drupal 8 is not always easy. Often they haven't been migrated from Drupal 7. Or they are still in beta. Or the documentation is either poor or non-existent.

That's why finding the MailChimp module was a true delight. In this tutorial, you will learn how to use this module to integrate your Drupal 8 site with MailChimp newsletter service.

Valuebound: Continuous integration using Jenkins and GitHub to automate deployment

Fri, 10/27/2017 - 11:35
Continuous Integration (CI) is rapidly becoming an integral part of software development process as it makes our monotonous and repetitive tasks a little less grindy. CI is a project development practice where developers integrate code into a shared repository frequently. Each Integration is then verified by an automated build that allows the team to detect problems in an early stage.

This post will walk you through the continuous integration with Jenkins and GitHub. Here we will install Jenkins, create Jenkins task and then configure it with GitHub.

Let’s get our arms around why Jenkins is so popular and why this is not just a hot topic, but an important best practice for developers…

InternetDevels: Supercharge your Drupal 8 website with special powers of Views

Fri, 10/27/2017 - 11:25

The Views module lets even non-developers organize and present the website's content in the desired ways. Website administrators love it, Drupal newbies start with it, and Drupal ninjas perform miracles with it. No wonder it used to be the most downloadable contributed module. Well, it still is — in Drupal 7.

Read more

Colan Schwartz: Representing Drupal at the GSoC 2017 Mentor Summit

Fri, 10/27/2017 - 01:25
Topics:  I've been mentoring students as part of Drupal's Google Summer of Code (GSoC) program for the last two years, where we guide students in working on Drupal projects over the summer. (For the projects I've been involved in, see User-friendly encryption now in Drupal 8! and Client-side encryption options now available in Drupal.) This year, our organization administrator, Matthew Lechleider, invited my to the Mentor Summit.

The Google-provided summit creates a forum for members of free/libre and open-source software (FLOSS) organizations to come together to discuss GSoC, mentoring and FLOSS in an unconference format. I met attendees from all over the world, who flew in from far-reaching places to interact as part of a wider community. Generally, two mentors are invited from each organization, but some had more and some had less.

I arrived late Friday night, having missed that day's introductory sessions due to some trouble at the US border. Historically, in my experience, we Canadians haven't had too much trouble getting across the border for technology conferences. This has recently changed so it's now necessary to provide proof of intent for being in the country (a signed invitation from the organizers) as well as proof of business activities (corporate and tax documents). Needless to say, all of this took a significant amount of time to prepare. Eventually though, I was allowed through and made my way to Sunnyvale, California.

On Saturday morning, the day started with Lightning Talks, where attendees gave presentations on their student projects having only a few minutes each to speak. There were so many presentations that it was necessary to split the session into two, continuing after dinner that same evening. While there were several interesting projects highlighted, the most interesting to me was Jitsi's speech-to-text service. Besides making video conferences accessible through textual media, it also allows for automated note-taking. This was one of the truly amazing projects completed by a student over the summer.

In talking about Drupal with other folks, I was surprised to hear that many other delegates do not have paying day jobs associated with their organizations. They work on these projects on the side, and generally don't get paid for them. For example, nobody in the Kodi contributor community gets paid; it's all volunteer work. While there are volunteer contributions to Drupal, many of those contributors eventually turn that knowledge into paid work. I suppose we're a lucky bunch, being able to work on an open-source project and get paid for it. And speaking of Kodi, I'm happy to report that they're using Drupal for their Web site!

There were quite a few conversations about messaging applications, with a large XMPP delegation. There were also folks from the Zulip and Rocket.Chat communities. It was interesting to hear from a former XMPP developer who's shifted completely to Matrix with the Riot client, exactly as I've done. I use that client and the federated protocol to bridge with other communications networks such as proprietary closed-source Slack and classic Internet Relay Chat (IRC) whenever possible. Matrix already integrates with these two protocols, and has built-in support. The goal is to eventually use only one messaging client, instead of the many applications we all have installed on all of our devices. Rocket.Chat has already started working on Matrix integration, while Zulip hasn't. They're open to it, and may move in this direction eventually, but for now they're focused on user-experience innovations. In the Drupal community, we've had a very long discussion about using Matrix for our communications alongside IRC, and have finally put a plan into place to make this happen. For those eager to jump in, it's now possible to use Matrix as an always-on IRC bouncer client to connect to Drupal's IRC channels for communication within the community. To sum up, it looks as though everything is moving towards Matrix.

Alongside Drupal, representatives from other content management systems (CMSes) also attended. There were folks from both the Joomla and Plone communities. It would have been great to connect with them, but I didn't get a chance. I was hoping that Airship would have representation as that crew has been doing a lot of excellent security work with PHP projects (including helping us).

All in all, it was an excellent conference. In my humble opinion, it's really important to stay in touch with this greater community, cross-pollinate with folks doing similar work in the public interest, and keep contributing!

This article, Representing Drupal at the GSoC 2017 Mentor Summit, appeared first on the Colan Schwartz Consulting Services blog.

PreviousNext: Sending Drupal entities to dialogflow with Chatbot API module

Thu, 10/26/2017 - 22:16
Share:

Services like dialogflow (formerly api.ai) do a much better job of natural language parsing (NLP) if they're aware of your entity names in advance.

For example, it can recognize that show me the weather in Bundaberg is a request for weather in Bundaberg, if you've told it ahead of time that Bundaberg is a valid value for the City entity.

Having the entity values automatically update in your service of choice when they're created and changed in Drupal makes this much more efficient.

This article will show you how to achieve that.

by Lee Rowlands / 27 October 2017

This is where the chatbot_api_entities sub-module comes in.

When you enable this module you can browse to Admin -> Config -> Web Services -> Entity Collections to create a collection.

The UI looks something like this:

Adding an entity collection to send to dialogflow in Drupal

Each collection comprises an entity-type and bundle as well as a push handler and a query handler.

By default Chatbot API Entities comes with a query handler for each entity-type and a specific one for Users to exclude blocked users.

The api_ai_webhook module comes with a push handler for pushing entities to your dialogflow/api.ai account.

By default, these plugins query based on available entities and the push handler pushes the entity labels.

Writing your own query handler

If for example, you don't want to extract entities from entity labels, e.g. you might wish to collect unique values from a particular field. In this case you can write your own query handler.

Here's an example that will query speaker names from a session content type. The collection handed to the push handler will contain all published sessions.

namespace Drupal\your_module\Plugin\ChatbotApiEntities\QueryHandler; use Drupal\chatbot_api_entities\Entity\EntityCollectionInterface; use Drupal\chatbot_api_entities\Plugin\QueryHandlerBase; use Drupal\Core\Entity\EntityTypeManagerInterface; /** * Defines a query handler that just uses entity query to limit as appropriate. * * @QueryHandler( * id = "speakers", * label = @Translation("Query speakers from sessions"), * ) */ class SpeakerQuery extends QueryHandlerBase { /** * {@inheritdoc} */ public function query(EntityTypeManagerInterface $entityTypeManager, array $existing = [], EntityCollectionInterface $collection) { $storage = $entityTypeManager->getStorage('node'); return $storage->loadMultiple($storage->getQuery() ->condition('type', 'session') ->exists('field_speaker_name') ->condition('status', 1) ->execute()); } /** * {@inheritdoc} */ public function applies($entity_type_id) { return $entity_type_id === 'node'; } }Writing your own push handler

Whilst we've written our own query handler to load entities that we wish to extract values from, we need to write our own push handler to handle sending anything other than the label.

Here's an example push handler that will push field values as entities to Api.ai/dialogflow

<?php namespace Drupal\your_module\Plugin\ChatbotApiEntities\PushHandler; use Drupal\api_ai_webhook\Plugin\ChatbotApiEntities\PushHandler\ApiAiPushHandler; use Drupal\chatbot_api_entities\Entity\EntityCollection; use Drupal\Core\Entity\EntityInterface; /** * Defines a handler for pushing entities to api.ai. * * @PushHandler( * id = "api_ai_webhook_speakers", * label = @Translation("API AI entities endpoint (speakers)") * ) */ class SpeakerPush extends ApiAiPushHandler { /** * {@inheritdoc} */ protected function formatEntries(array $entities, EntityCollection $entityCollection) { // Format for API.ai/dialogflow. return array_map(function ($item) { return [ 'value' => $item, 'synonyms' => [], ]; }, // Key by name to remove duplicates. array_reduce($entities, function (array $carry, EntityInterface $entity) { $value = $entity->field_speaker_name->value; $carry[$value] = $value; return $carry; }, [])); } } Learn more

If you're interested in learning more about Chatbots and conversational UI with Drupal, I'm presenting a session on these topics at Drupal South 2017, the Southern Hemisphere's biggest Drupal Camp. October 31st is the deadline for getting your tickets at standard prices, so if you plan to attend, be sure to get yours this week to avoid the price hike.

I hope to see you there.

Tagged AI, Natural Language Parsing, Chatbot, Drupal 8

Posted by Lee Rowlands
Senior Drupal Developer

Dated 27 October 2017

Add new comment

Dries Buytaert: Shopping with augmented reality

Thu, 10/26/2017 - 17:34

Last spring, Acquia Labs built a chatbot prototype that helps customers choose recipes and plan shopping lists with dietary restrictions and preferences in mind. The ability to interact with a chatbot assistant rather than having to research and plan everything on your own can make grocery shopping much easier. We wanted to take this a step further and explore how augmented reality could also improve the shopping experience.


The demo video above features how a shopper named Alex can interact with an augmented reality application to remove friction from her shopping experience at Freshland Market (a fictional grocery store). The Freshland Market mobile application not only guides Alex through her shopping list but also helps her to make more informed shopping decisions through augmented reality overlays. It superimposes useful information such as price, user ratings and recommended recipes, over shopping items detected by a smartphone camera. The application can personalize Alex's shopping experience by highlighting products that fit her dietary restrictions or preferences.

What is exciting about this demo is that the Acquia Labs team built the Freshland Market application with Drupal 8 and augmented reality technology that is commercially available today.

The first step in developing the application was to use an augmented reality library, Vuforia, which identifies pre-configured targets. In our demo, these targets are images of product labels, such as the tomato sauce and cereal labels shown in the video. Each target is given a unique ID. This ID is used to query the Freshland Market Drupal site for content related to that target.

The Freshland Market site stores all of the product information in Drupal, including price, dietary concerns, and reviews. Thanks to Drupal's web services support and the JSON API module, Drupal 8 can serve content to the Freshland Market application. This means that if the Drupal content for Rosemary & Olive Oil chips is edited to mark the item on sale, this will automatically be reflected in the content superimposed through the mobile application.

In addition to information on price and nutrition, the Freshland Market site also stores the location of each product. This makes it possible to guide a shopper to the product's location in the store, evolving the shopping list into a shopping route. This makes finding grocery items easy.

Augmented reality is building momentum because it moves beyond the limits of a traditional user interface, or in our case, the traditional website. It superimposes a digital layer onto a user's actual world. This technology is still emerging, and is not as established as virtual assistants and wearables, but it continues to gain traction. In 2016, the augmented reality market was valued at $2.39 billion and it is expected to reach $61.39 billion by 2023.

What is exciting is that these new technology trends require content management solutions. In the featured demo, there is a large volume of product data and content that needs to be managed in order to serve the augmented reality capabilities of the Freshland Market mobile application. The Drupal community's emphasis on making Drupal API-first in addition to supporting distributions like Reservoir means that Drupal 8 is prepared to support emerging channels.

If you are ready to start reimagining how your organization interacts with its users, or how to take advantage of new technology trends, Acquia Labs is here to help.

Special thanks to Chris Hamper and Preston So for building the Freshland Market augmented reality application, and thank you to Ash Heath and Drew Robertson for producing the demo video.

Acro Media: Video: Reporting in Drupal Commerce 2.x is Going to be Great!

Thu, 10/26/2017 - 15:08


The good news is that Commerce 2.x has the potential to handle tons of different reports and display the data any way you want. The dashboard is complete and the framework is impressive. The catch is that many of the reports don’t technically exist yet, so you need to do a little configuring to make sure you’re looking at the data that’s most important to you.

What kind of reports are we talking about?

You could have a whole suite of point-of-sale reports, for instance (in Commerce 1, they were their own set of reports; in Commerce 2, they just build on Commerce reporting). If you need reports for checkout, or cart, or analytics, you can have them all in the Commerce reporting suite, even if they are vastly different types of reports. So you can have reports for different people who manage different metrics, but you can build them all using the same framework.

Pages